home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 March / CMCD0305.ISO / Software / Demo / Itcomm / auscomp-itcommander-win5.exe / {pf} / Firebird / include / ibase.h < prev    next >
C/C++ Source or Header  |  2004-02-20  |  90KB  |  2,756 lines

  1. /*
  2.  *    MODULE:        ibase.h
  3.  *    DESCRIPTION:    OSRI entrypoints and defines
  4.  *
  5.  * The contents of this file are subject to the Interbase Public
  6.  * License Version 1.0 (the "License"); you may not use this file
  7.  * except in compliance with the License. You may obtain a copy
  8.  * of the License at http://www.Inprise.com/IPL.html
  9.  *
  10.  * Software distributed under the License is distributed on an
  11.  * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
  12.  * or implied. See the License for the specific language governing
  13.  * rights and limitations under the License.
  14.  *
  15.  * The Original Code was created by Inprise Corporation
  16.  * and its predecessors. Portions created by Inprise Corporation are
  17.  * Copyright (C) Inprise Corporation.
  18.  *
  19.  * All Rights Reserved.
  20.  * Contributor(s): ______________________________________.
  21.  */
  22.  
  23. #ifndef JRD_IBASE_H
  24. #define JRD_IBASE_H
  25.  
  26.  
  27. /******************************************************************/
  28. /* Define type, export and other stuff based on c/c++ and Windows */
  29. /******************************************************************/
  30.  
  31. #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
  32. #ifndef __GNUC__
  33. typedef __int64                ISC_INT64;
  34. typedef unsigned __int64    ISC_UINT64;
  35. #define  ISC_INT64_DEFINED
  36. #endif
  37. #define  ISC_EXPORT    __stdcall
  38. #define  ISC_EXPORT_VARARG    __cdecl
  39. #else
  40. #define  ISC_EXPORT
  41. #define  ISC_EXPORT_VARARG
  42. #endif
  43.  
  44. /*******************************************************************/
  45. /* 64 bit Integers                                                 */
  46. /*******************************************************************/
  47.  
  48. #ifdef  ISC_INT64_DEFINED
  49. #undef  ISC_INT64_DEFINED
  50. #else
  51. typedef long long int            ISC_INT64;
  52. typedef unsigned long long int    ISC_UINT64;
  53. #endif
  54.  
  55. #if SIZEOF_LONG == 8
  56.     /* EKU: Firebird requires (S)LONG to be 32 bit */
  57. #   define LONG_DEFINED
  58.     typedef int SLONG;
  59.     typedef unsigned int ULONG;
  60.  
  61. #   define SQUAD_DEFINED
  62.     typedef long SQUAD;
  63.     typedef unsigned long UQUAD;
  64. #   define NATIVE_QUAD
  65. #endif /* SIZEOF_LONG == 8 */
  66.  
  67.  
  68.  
  69. /* Basic data types */
  70.  
  71.  
  72. #ifdef NOT_USED_OR_REPLACED
  73. typedef signed char SCHAR;
  74. #else
  75. /* TMN: TODO It seems SCHAR is used just about *everywhere* where a plain
  76.  * "char" is really intended. This currently forces us to this bad definition.
  77.  */
  78. typedef char SCHAR;
  79. #endif
  80.  
  81.  
  82. typedef unsigned char UCHAR;
  83. typedef short SSHORT;
  84. typedef unsigned short USHORT;
  85.  
  86.  
  87. #ifndef LONG_DEFINED            /* 32 bit */
  88. typedef long SLONG;
  89. typedef unsigned long ULONG;
  90. #else
  91. #undef LONG_DEFINED
  92. #endif
  93.  
  94.  
  95. #ifndef SQUAD_DEFINED            /* 64 bit */
  96. typedef struct {
  97.     SLONG high;
  98.     ULONG low;
  99. } SQUAD;
  100. #endif
  101.  
  102.  
  103. #ifndef DEFINED_GDS_QUAD
  104. #define DEFINED_GDS_QUAD
  105. struct GDS_QUAD_t {
  106.     SLONG gds_quad_high;
  107.     ULONG gds_quad_low;
  108. };
  109.  
  110. typedef struct GDS_QUAD_t GDS_QUAD;
  111.  
  112. #endif /* DEFINED_GDS_QUAD */
  113.  
  114. //
  115. // TMN: some misc data types from all over the place
  116. //
  117. struct vary
  118. {
  119.     USHORT vary_length;
  120.     char   vary_string[1];
  121. };
  122. // TMN: Currently we can't do this, since remote uses a different
  123. // definition of VARY than the rest of the code! :-<
  124. //typedef vary* VARY;
  125.  
  126. struct lstring
  127. {
  128.     ULONG    lstr_length;
  129.     ULONG    lstr_allocated;
  130.     UCHAR*    lstr_address;
  131. };
  132. typedef struct lstring LSTRING;
  133.  
  134.  
  135. typedef unsigned char BOOLEAN;
  136. typedef char TEXT;                // To be expunged over time
  137. //typedef unsigned char STEXT;    Signed text - not used
  138. //typedef unsigned char UTEXT;    Unsigned text - not used
  139. typedef unsigned char BYTE;        // Unsigned byte - common
  140. //typedef char SBYTE;            Signed byte - not used
  141. typedef long ISC_STATUS;
  142. typedef long IPTR;
  143. typedef unsigned long U_IPTR;
  144. typedef void (*FPTR_VOID) ();
  145. typedef void (*FPTR_VOID_PTR) (void *);
  146. typedef int (*FPTR_INT) ();
  147. typedef int (*FPTR_INT_VOID_PTR) (void *);
  148. typedef ULONG RCRD_OFFSET;
  149. typedef USHORT FLD_LENGTH;
  150. typedef int (*lock_ast_t)(void *);
  151.  
  152. #define ISC_STATUS_LENGTH    20
  153. typedef ISC_STATUS ISC_STATUS_ARRAY[ISC_STATUS_LENGTH];
  154.  
  155. /* Number of elements in an arry */
  156. #define FB_NELEM(x)    ((int)(sizeof(x) / sizeof(x[0])))
  157. #define FB_ALIGN(n,b) ((n+b-1)&~(b-1))
  158.  
  159.  
  160. #define FB_API_VER 15
  161. #define isc_version4
  162.  
  163. #define  ISC_TRUE    1
  164. #define  ISC_FALSE    0
  165. #if !(defined __cplusplus)
  166. #define  ISC__TRUE    ISC_TRUE
  167. #define  ISC__FALSE    ISC_FALSE
  168. #endif
  169.  
  170. #define ISC_FAR
  171.  
  172. #if SIZEOF_LONG == 8
  173. typedef    int        ISC_LONG;
  174. typedef    unsigned int    ISC_ULONG;
  175. #else
  176. typedef    signed long    ISC_LONG;
  177. typedef    unsigned long    ISC_ULONG;
  178. #endif
  179.  
  180. typedef    signed short    ISC_SHORT;
  181. typedef    unsigned short    ISC_USHORT;
  182.  
  183. typedef    unsigned char    ISC_UCHAR;
  184.  
  185. #define  DSQL_close     1
  186. #define  DSQL_drop      2
  187.  
  188.  
  189. /********************************/
  190. /* InterBase Handle Definitions */
  191. /********************************/
  192.  
  193. #ifndef JRD_Y_REF_H
  194. #define FRBRD void
  195. #endif
  196.  
  197. typedef FRBRD * isc_att_handle;
  198. typedef FRBRD * isc_blob_handle;
  199. typedef FRBRD * isc_db_handle;
  200. typedef FRBRD * isc_req_handle;
  201. typedef FRBRD * isc_stmt_handle;
  202. typedef FRBRD * isc_svc_handle;
  203. typedef FRBRD * isc_tr_handle;
  204. typedef void (* isc_callback) ();
  205. typedef ISC_LONG isc_resv_handle;
  206.  
  207. /*******************************************************************/
  208. /* Time & Date Support                                             */
  209. /*******************************************************************/
  210.  
  211. #ifndef ISC_TIMESTAMP_DEFINED
  212. typedef long            ISC_DATE;
  213. typedef unsigned long    ISC_TIME;
  214. typedef struct
  215. {
  216.     ISC_DATE timestamp_date;
  217.     ISC_TIME timestamp_time;
  218. } ISC_TIMESTAMP;
  219. #define ISC_TIMESTAMP_DEFINED
  220. #endif    /* ISC_TIMESTAMP_DEFINED */
  221.  
  222. #define ISC_TIME_SECONDS_PRECISION          10000L
  223. #define ISC_TIME_SECONDS_PRECISION_SCALE    (-4)
  224.  
  225. /*******************************************************************/
  226. /* Blob id structure                                               */
  227. /*******************************************************************/
  228.  
  229. #if !(defined __cplusplus)
  230. typedef GDS_QUAD GDS__QUAD;
  231. #endif /* !(defined __cplusplus) */
  232.  
  233. typedef struct GDS_QUAD_t ISC_QUAD;
  234.  
  235. #define    isc_quad_high    gds_quad_high
  236. #define    isc_quad_low    gds_quad_low
  237.  
  238. typedef struct
  239. {
  240.     short array_bound_lower;
  241.     short array_bound_upper;
  242. } ISC_ARRAY_BOUND;
  243.  
  244. typedef struct
  245. {
  246.     unsigned char    array_desc_dtype;
  247.     char            array_desc_scale;
  248.     unsigned short    array_desc_length;
  249.     char            array_desc_field_name[32];
  250.     char            array_desc_relation_name[32];
  251.     short            array_desc_dimensions;
  252.     short            array_desc_flags;
  253.     ISC_ARRAY_BOUND    array_desc_bounds[16];
  254. } ISC_ARRAY_DESC;
  255.  
  256. typedef struct
  257. {
  258.     short            blob_desc_subtype;
  259.     short            blob_desc_charset;
  260.     short            blob_desc_segment_size;
  261.     unsigned char    blob_desc_field_name[32];
  262.     unsigned char    blob_desc_relation_name[32];
  263. } ISC_BLOB_DESC;
  264.  
  265.  
  266.  
  267. /***************************/
  268. /* Blob control structure  */
  269. /***************************/
  270.  
  271. typedef struct isc_blob_ctl
  272. {
  273.     ISC_STATUS    (* ctl_source)();    /* Source filter */
  274.     struct isc_blob_ctl *    ctl_source_handle;    /* Argument to pass to source filter */
  275.     short                    ctl_to_sub_type;        /* Target type */
  276.     short                    ctl_from_sub_type;        /* Source type */
  277.     unsigned short            ctl_buffer_length;        /* Length of buffer */
  278.     unsigned short            ctl_segment_length;        /* Length of current segment */
  279.     unsigned short            ctl_bpb_length;            /* Length of blob parameter  block */
  280.     char *                    ctl_bpb;                /* Address of blob parameter block */
  281.     unsigned char *            ctl_buffer;                /* Address of segment buffer */
  282.     ISC_LONG                ctl_max_segment;        /* Length of longest segment */
  283.     ISC_LONG                ctl_number_segments;    /* Total number of segments */
  284.     ISC_LONG                ctl_total_length;        /* Total length of blob */
  285.     ISC_STATUS *            ctl_status;                /* Address of status vector */
  286.     long                    ctl_data[8];            /* Application specific data */
  287. } * ISC_BLOB_CTL;
  288.  
  289. /***************************/
  290. /* Blob stream definitions */
  291. /***************************/
  292.  
  293. typedef struct bstream
  294. {
  295.     isc_blob_handle    bstr_blob;        /* Blob handle */
  296.     char *            bstr_buffer;    /* Address of buffer */
  297.     char *            bstr_ptr;        /* Next character */
  298.     short            bstr_length;    /* Length of buffer */
  299.     short            bstr_cnt;        /* Characters in buffer */
  300.     char            bstr_mode;        /* (mode) ? OUTPUT : INPUT */
  301. } BSTREAM;
  302.  
  303. /* Three ugly macros, one even using octal radix... sigh... */
  304. #define getb(p)    (--(p)->bstr_cnt >= 0 ? *(p)->bstr_ptr++ & 0377: BLOB_get (p))
  305. #define putb(x,p) (((x) == '\n' || (!(--(p)->bstr_cnt))) ? BLOB_put ((x),p) : ((int) (*(p)->bstr_ptr++ = (unsigned) (x))))
  306. #define putbx(x,p) ((!(--(p)->bstr_cnt)) ? BLOB_put ((x),p) : ((int) (*(p)->bstr_ptr++ = (unsigned) (x))))
  307.  
  308.  
  309. /********************************************************************/
  310. /* CVC: Public blob interface definition held in val.h.             */
  311. /* For some unknown reason, it was only documented in langRef       */
  312. /* and being the structure passed by the engine to UDFs it never    */
  313. /* made its way into this public definitions file.                  */
  314. /* Being its original name "blob", I renamed it blobcallback here.  */
  315. /* I did the full definition with the proper parameters instead of  */
  316. /* the weak C declaration with any number and type of parameters.   */
  317. /* Since the first parameter -BLB- is unknown outside the engine,   */
  318. /* it's more accurate to use void* than int* as the blob pointer    */
  319. /********************************************************************/
  320.  
  321. #if !defined(JRD_VAL_H) && !defined(REQUESTER)
  322. /* Blob passing structure */
  323.  
  324. enum lseek_mode {blb_seek_relative = 1, blb_seek_from_tail = 2};
  325.  
  326. typedef struct blobcallback {
  327.     short ( *blob_get_segment)
  328.         (void * hnd, unsigned char* buffer, ISC_USHORT buf_size, ISC_USHORT* result_len);
  329.     void            *blob_handle;
  330.     ISC_LONG    blob_number_segments;
  331.     ISC_LONG    blob_max_segment;
  332.     ISC_LONG    blob_total_length;
  333.     void ( *blob_put_segment)
  334.         (void * hnd, unsigned char* buffer, ISC_USHORT buf_size);
  335.     ISC_LONG ( *blob_lseek)
  336.         (void * hnd, ISC_USHORT mode, ISC_LONG offset);
  337. }  *BLOBCALLBACK;
  338. #endif /* !defined(JRD_VAL_H) && !defined(REQUESTER) */
  339.  
  340.  
  341.  
  342. /********************************************************************/
  343. /* CVC: Public descriptor interface held in dsc.h.                  */
  344. /* We need it documented to be able to recognize NULL in UDFs.      */
  345. /* Being its original name "dsc", I renamed it paramdsc here.       */
  346. /* Notice that I adjust to the original definition: contrary to     */
  347. /* other cases, the typedef is the same struct not the pointer.     */
  348. /* I included the enumeration of dsc_dtype possible values.         */
  349. /* Ultimately, dsc.h should be part of the public interface.        */
  350. /********************************************************************/
  351.  
  352. #if !defined(JRD_DSC_H)
  353. /* This is the famous internal descriptor that UDFs can use, too. */
  354. typedef struct paramdsc {
  355.     unsigned char    dsc_dtype;
  356.     signed char        dsc_scale;
  357.     ISC_USHORT        dsc_length;
  358.     short        dsc_sub_type;
  359.     ISC_USHORT        dsc_flags;
  360.     unsigned char    *dsc_address;
  361. } PARAMDSC;
  362.  
  363. #if !defined(JRD_VAL_H)
  364. /* This is a helper struct to work with varchars. */
  365. typedef struct paramvary {
  366.     ISC_USHORT        vary_length;
  367.     unsigned char    vary_string [1];
  368. } PARAMVARY;
  369. #endif /* !defined(JRD_VAL_H) */
  370.  
  371. /* values for dsc_flags */
  372. /* Note: DSC_null is only reliably set for local variables
  373.    (blr_variable) */
  374. #define DSC_null        1
  375. #define DSC_no_subtype        2    /* dsc has no sub type specified */
  376. #define DSC_nullable          4    /* not stored. instead, is derived
  377.                                     from metadata primarily to flag
  378.                                      SQLDA (in DSQL)               */
  379.  
  380. /* Overload text typing information into the dsc_sub_type field.
  381.    See intl.h for definitions of text types */ 
  382.  
  383. #ifndef dsc_ttype
  384. #define dsc_ttype    dsc_sub_type
  385. #endif
  386.  
  387.  
  388. /* Note that dtype_null actually means that we do not yet know the
  389.    dtype for this descriptor.  A nice cleanup item would be to globally
  390.    change it to dtype_unknown.  --chrisj 1999-02-17 */
  391.  
  392. #define dtype_null    0
  393. #define dtype_text    1
  394. #define dtype_cstring    2
  395. #define dtype_varying    3
  396.  
  397. #define dtype_packed    6
  398. #define dtype_byte    7
  399. #define dtype_short    8
  400. #define dtype_long    9
  401. #define dtype_quad    10
  402. #define dtype_real    11
  403. #define dtype_double    12
  404. #define dtype_d_float    13
  405. #define dtype_sql_date    14
  406. #define dtype_sql_time    15
  407. #define dtype_timestamp    16
  408. #define dtype_blob    17
  409. #define dtype_array    18
  410. #define dtype_int64     19
  411. #define DTYPE_TYPE_MAX    20
  412. #endif /* !defined(JRD_DSC_H) */
  413.  
  414.  
  415. /***************************/
  416. /* Dynamic SQL definitions */
  417. /***************************/
  418.  
  419. /******************************/
  420. /* Declare the extended SQLDA */
  421. /******************************/
  422.  
  423. #ifndef FB_SQLDA
  424.  
  425. typedef struct
  426. {
  427.     short            sqltype;            /* datatype of field */
  428.     short            sqlscale;            /* scale factor */
  429.     short            sqlsubtype;            /* datatype subtype - BLOBs & Text types only */
  430.     short            sqllen;                /* length of data area */
  431.     char *            sqldata;            /* address of data */
  432.     short *            sqlind;                /* address of indicator variable */
  433.     short            sqlname_length;        /* length of sqlname field */
  434.     char            sqlname[32];        /* name of field, name length + space for NULL */
  435.     short            relname_length;        /* length of relation name */
  436.     char            relname[32];        /* field's relation name + space for NULL */
  437.     short            ownname_length;        /* length of owner name */
  438.     char            ownname[32];        /* relation's owner name + space for  NULL */
  439.     short            aliasname_length;    /* length of alias name */
  440.     char            aliasname[32];        /* relation's alias name + space for NULL */
  441. } XSQLVAR;
  442.  
  443. typedef struct
  444. {
  445.     short        version;            /* version of this XSQLDA */
  446.     char        sqldaid[8];            /* XSQLDA name field */
  447.     ISC_LONG    sqldabc;            /* length in bytes of SQLDA */
  448.     short        sqln;                /* number of fields allocated */
  449.     short        sqld;                /* actual number of fields */
  450.     XSQLVAR        sqlvar[1];            /* first field address */
  451. } XSQLDA;
  452.  
  453. #define XSQLDA_LENGTH(n)    (sizeof (XSQLDA) + ((n)-1) * sizeof (XSQLVAR))
  454.  
  455. #define SQLDA_VERSION1                1
  456.  
  457. #define SQL_DIALECT_V5                1    /* meaning is same as DIALECT_xsqlda */
  458. #define SQL_DIALECT_V6_TRANSITION    2    /* flagging anything that is delimited
  459.                                            by double quotes as an error and
  460.                                            flagging keyword DATE as an error */
  461. #define SQL_DIALECT_V6                3    /* supports SQL delimited identifier,
  462.                                            SQLDATE/DATE, TIME, TIMESTAMP,
  463.                                            CURRENT_DATE, CURRENT_TIME,
  464.                                            CURRENT_TIMESTAMP, and 64-bit exact
  465.                                            numeric type */
  466. #define SQL_DIALECT_CURRENT        SQL_DIALECT_V6    /* latest IB DIALECT */
  467.  
  468.  
  469. #define FB_SQLDA
  470. #endif
  471.  
  472. /***************************/
  473. /* OSRI database functions */
  474. /***************************/
  475.  
  476. #ifdef __cplusplus
  477. extern "C" {
  478. #endif
  479.  
  480. ISC_STATUS ISC_EXPORT isc_attach_database(ISC_STATUS *,
  481.                                           short,
  482.                                           char *,
  483.                                           isc_db_handle *,
  484.                                           short,
  485.                                           char *);
  486.  
  487. ISC_STATUS ISC_EXPORT isc_array_gen_sdl(ISC_STATUS *,
  488.                                         ISC_ARRAY_DESC *,
  489.                                         short *,
  490.                                         char *,
  491.                                         short *);
  492.  
  493. ISC_STATUS ISC_EXPORT isc_array_get_slice(ISC_STATUS *,
  494.                                           isc_db_handle *,
  495.                                           isc_tr_handle *,
  496.                                           ISC_QUAD *,
  497.                                           ISC_ARRAY_DESC *,
  498.                                           void *,
  499.                                           ISC_LONG *);
  500.  
  501. ISC_STATUS ISC_EXPORT isc_array_lookup_bounds(ISC_STATUS *,
  502.                                               isc_db_handle *,
  503.                                               isc_tr_handle *,
  504.                                               char *,
  505.                                               char *,
  506.                                               ISC_ARRAY_DESC *);
  507.  
  508. ISC_STATUS ISC_EXPORT isc_array_lookup_desc(ISC_STATUS *,
  509.                                             isc_db_handle *,
  510.                                             isc_tr_handle *,
  511.                                             char *,
  512.                                             char *,
  513.                                             ISC_ARRAY_DESC *);
  514.  
  515. ISC_STATUS ISC_EXPORT isc_array_set_desc(ISC_STATUS *,
  516.                                          char *,
  517.                                          char *,
  518.                                          short *,
  519.                                          short *,
  520.                                          short *,
  521.                                          ISC_ARRAY_DESC *);
  522.  
  523. ISC_STATUS ISC_EXPORT isc_array_put_slice(ISC_STATUS *,
  524.                                           isc_db_handle *,
  525.                                           isc_tr_handle *,
  526.                                           ISC_QUAD *,
  527.                                           ISC_ARRAY_DESC *,
  528.                                           void *,
  529.                                           ISC_LONG *);
  530.  
  531. void ISC_EXPORT isc_blob_default_desc(ISC_BLOB_DESC *,
  532.                                       unsigned char *,
  533.                                       unsigned char *);
  534.  
  535. ISC_STATUS ISC_EXPORT isc_blob_gen_bpb(ISC_STATUS *,
  536.                                        ISC_BLOB_DESC *,
  537.                                        ISC_BLOB_DESC *,
  538.                                        unsigned short,
  539.                                        unsigned char *,
  540.                                        unsigned short *);
  541.  
  542. ISC_STATUS ISC_EXPORT isc_blob_info(ISC_STATUS *,
  543.                                     isc_blob_handle *,
  544.                                     short,
  545.                                     char *,
  546.                                     short,
  547.                                     char *);
  548.  
  549. ISC_STATUS ISC_EXPORT isc_blob_lookup_desc(ISC_STATUS *,
  550.                                            isc_db_handle *,
  551.                                            isc_tr_handle *,
  552.                                            unsigned char *,
  553.                                            unsigned char *,
  554.                                            ISC_BLOB_DESC *,
  555.                                            unsigned char *);
  556.  
  557. ISC_STATUS ISC_EXPORT isc_blob_set_desc(ISC_STATUS *,
  558.                                         unsigned char *,
  559.                                         unsigned char *,
  560.                                         short,
  561.                                         short,
  562.                                         short,
  563.                                         ISC_BLOB_DESC *);
  564.  
  565. ISC_STATUS ISC_EXPORT isc_cancel_blob(ISC_STATUS *,
  566.                                       isc_blob_handle *);
  567.  
  568. ISC_STATUS ISC_EXPORT isc_cancel_events(ISC_STATUS *,
  569.                                         isc_db_handle *,
  570.                                         ISC_LONG *);
  571.  
  572. ISC_STATUS ISC_EXPORT isc_close_blob(ISC_STATUS *,
  573.                                      isc_blob_handle *);
  574.  
  575. ISC_STATUS ISC_EXPORT isc_commit_retaining(ISC_STATUS *,
  576.                                            isc_tr_handle *);
  577.  
  578. ISC_STATUS ISC_EXPORT isc_commit_transaction(ISC_STATUS *,
  579.                                              isc_tr_handle *);
  580.  
  581. ISC_STATUS ISC_EXPORT isc_create_blob(ISC_STATUS *,
  582.                                       isc_db_handle *,
  583.                                       isc_tr_handle *,
  584.                                       isc_blob_handle *,
  585.                                       ISC_QUAD *);
  586.  
  587. ISC_STATUS ISC_EXPORT isc_create_blob2(ISC_STATUS *,
  588.                                        isc_db_handle *,
  589.                                        isc_tr_handle *,
  590.                                        isc_blob_handle *,
  591.                                        ISC_QUAD *,
  592.                                        short,
  593.                                        char *);
  594.  
  595. ISC_STATUS ISC_EXPORT isc_create_database(ISC_STATUS *,
  596.                                           short,
  597.                                           char *,
  598.                                           isc_db_handle *,
  599.                                           short,
  600.                                           char *,
  601.                                           short);
  602.  
  603. ISC_STATUS ISC_EXPORT isc_database_info(ISC_STATUS *,
  604.                                         isc_db_handle *,
  605.                                         short,
  606.                                         char *,
  607.                                         short,
  608.                                         char *);
  609.  
  610. void ISC_EXPORT isc_decode_date(ISC_QUAD *,
  611.                                 void *);
  612.  
  613. void ISC_EXPORT isc_decode_sql_date(ISC_DATE *,
  614.                                     void *);
  615.  
  616. void ISC_EXPORT isc_decode_sql_time(ISC_TIME *,
  617.                                     void *);
  618.  
  619. void ISC_EXPORT isc_decode_timestamp(ISC_TIMESTAMP *,
  620.                                      void *);
  621.  
  622. ISC_STATUS ISC_EXPORT isc_detach_database(ISC_STATUS *,
  623.                                           isc_db_handle *);
  624.  
  625. ISC_STATUS ISC_EXPORT isc_drop_database(ISC_STATUS *,
  626.                                         isc_db_handle *);
  627.  
  628. ISC_STATUS ISC_EXPORT isc_dsql_allocate_statement(ISC_STATUS *,
  629.                                                   isc_db_handle *,
  630.                                                   isc_stmt_handle *);
  631.  
  632. ISC_STATUS ISC_EXPORT isc_dsql_alloc_statement2(ISC_STATUS *,
  633.                                                 isc_db_handle *,
  634.                                                 isc_stmt_handle *);
  635.  
  636. ISC_STATUS ISC_EXPORT isc_dsql_describe(ISC_STATUS *,
  637.                                         isc_stmt_handle *,
  638.                                         unsigned short,
  639.                                         XSQLDA *);
  640.  
  641. ISC_STATUS ISC_EXPORT isc_dsql_describe_bind(ISC_STATUS *,
  642.                                              isc_stmt_handle *,
  643.                                              unsigned short,
  644.                                              XSQLDA *);
  645.  
  646. ISC_STATUS ISC_EXPORT isc_dsql_exec_immed2(ISC_STATUS *,
  647.                                            isc_db_handle *,
  648.                                            isc_tr_handle *,
  649.                                            unsigned short,
  650.                                            char *,
  651.                                            unsigned short,
  652.                                            XSQLDA *,
  653.                                            XSQLDA *);
  654.  
  655. ISC_STATUS ISC_EXPORT isc_dsql_execute(ISC_STATUS *,
  656.                                        isc_tr_handle *,
  657.                                        isc_stmt_handle *,
  658.                                        unsigned short,
  659.                                        XSQLDA *);
  660.  
  661. ISC_STATUS ISC_EXPORT isc_dsql_execute2(ISC_STATUS *,
  662.                                         isc_tr_handle *,
  663.                                         isc_stmt_handle *,
  664.                                         unsigned short,
  665.                                         XSQLDA *,
  666.                                         XSQLDA *);
  667.  
  668. ISC_STATUS ISC_EXPORT isc_dsql_execute_immediate(ISC_STATUS *,
  669.                                                  isc_db_handle *,
  670.                                                  isc_tr_handle *,
  671.                                                  unsigned short,
  672.                                                  char *,
  673.                                                  unsigned short,
  674.                                                  XSQLDA *);
  675.  
  676. ISC_STATUS ISC_EXPORT isc_dsql_fetch(ISC_STATUS *,
  677.                                      isc_stmt_handle *,
  678.                                      unsigned short,
  679.                                      XSQLDA *);
  680.  
  681. ISC_STATUS ISC_EXPORT isc_dsql_finish(isc_db_handle *);
  682.  
  683. ISC_STATUS ISC_EXPORT isc_dsql_free_statement(ISC_STATUS *,
  684.                                               isc_stmt_handle *,
  685.                                               unsigned short);
  686.  
  687. ISC_STATUS ISC_EXPORT isc_dsql_insert(ISC_STATUS *,
  688.                                       isc_stmt_handle *,
  689.                                       unsigned short,
  690.                                       XSQLDA *);
  691.  
  692. ISC_STATUS ISC_EXPORT isc_dsql_prepare(ISC_STATUS *,
  693.                                        isc_tr_handle *,
  694.                                        isc_stmt_handle *,
  695.                                        unsigned short,
  696.                                        char *,
  697.                                        unsigned short,
  698.                                        XSQLDA *);
  699.  
  700. ISC_STATUS ISC_EXPORT isc_dsql_set_cursor_name(ISC_STATUS *,
  701.                                                isc_stmt_handle *,
  702.                                                char *,
  703.                                                unsigned short);
  704.  
  705. ISC_STATUS ISC_EXPORT isc_dsql_sql_info(ISC_STATUS *,
  706.                                         isc_stmt_handle *,
  707.                                         short,
  708.                                         const char *,
  709.                                         short,
  710.                                         char *);
  711.  
  712. void ISC_EXPORT isc_encode_date(void *,
  713.                                 ISC_QUAD *);
  714.  
  715. void ISC_EXPORT isc_encode_sql_date(void *,
  716.                                     ISC_DATE *);
  717.  
  718. void ISC_EXPORT isc_encode_sql_time(void *,
  719.                                     ISC_TIME *);
  720.  
  721. void ISC_EXPORT isc_encode_timestamp(void *,
  722.                                      ISC_TIMESTAMP *);
  723.  
  724. ISC_LONG ISC_EXPORT_VARARG isc_event_block(char * *,
  725.                                            char * *,
  726.                                            unsigned short, ...);
  727.  
  728. void ISC_EXPORT isc_event_counts(ISC_ULONG *,
  729.                                  short,
  730.                                  char *,
  731.                                  char *);
  732.  
  733. /* 17 May 2001 - isc_expand_dpb is DEPRECATED */
  734. void ISC_EXPORT_VARARG isc_expand_dpb(char * *,
  735.                                       short *, ...);
  736.  
  737. int ISC_EXPORT isc_modify_dpb(char * *,
  738.                               short *,
  739.                               unsigned short,
  740.                               char *,
  741.                               short);
  742.  
  743. ISC_LONG ISC_EXPORT isc_free(char *);
  744.  
  745. ISC_STATUS ISC_EXPORT isc_get_segment(ISC_STATUS *,
  746.                                       isc_blob_handle *,
  747.                                       unsigned short *,
  748.                                       unsigned short,
  749.                                       char *);
  750.  
  751. ISC_STATUS ISC_EXPORT isc_get_slice(ISC_STATUS *,
  752.                                     isc_db_handle *,
  753.                                     isc_tr_handle *,
  754.                                     ISC_QUAD *,
  755.                                     short,
  756.                                     char *,
  757.                                     short,
  758.                                     ISC_LONG *,
  759.                                     ISC_LONG,
  760.                                     void *,
  761.                                     ISC_LONG *);
  762.  
  763. ISC_STATUS ISC_EXPORT isc_interprete(char *,
  764.                                      ISC_STATUS * *);
  765.  
  766. ISC_STATUS ISC_EXPORT isc_open_blob(ISC_STATUS *,
  767.                                     isc_db_handle *,
  768.                                     isc_tr_handle *,
  769.                                     isc_blob_handle *,
  770.                                     ISC_QUAD *);
  771.  
  772. ISC_STATUS ISC_EXPORT isc_open_blob2(ISC_STATUS *,
  773.                                      isc_db_handle *,
  774.                                      isc_tr_handle *,
  775.                                      isc_blob_handle *,
  776.                                      ISC_QUAD *,
  777.                                      ISC_USHORT,
  778.                                      ISC_UCHAR *);
  779.  
  780. ISC_STATUS ISC_EXPORT isc_prepare_transaction2(ISC_STATUS *,
  781.                                                isc_tr_handle *,
  782.                                                ISC_USHORT,
  783.                                                ISC_UCHAR *);
  784.  
  785. void ISC_EXPORT isc_print_sqlerror(ISC_SHORT,
  786.                                    ISC_STATUS *);
  787.  
  788. ISC_STATUS ISC_EXPORT isc_print_status(ISC_STATUS *);
  789.  
  790. ISC_STATUS ISC_EXPORT isc_put_segment(ISC_STATUS *,
  791.                                       isc_blob_handle *,
  792.                                       unsigned short,
  793.                                       char *);
  794.  
  795. ISC_STATUS ISC_EXPORT isc_put_slice(ISC_STATUS *,
  796.                                     isc_db_handle *,
  797.                                     isc_tr_handle *,
  798.                                     ISC_QUAD *,
  799.                                     short,
  800.                                     char *,
  801.                                     short,
  802.                                     ISC_LONG *,
  803.                                     ISC_LONG,
  804.                                     void *);
  805.  
  806. ISC_STATUS ISC_EXPORT isc_que_events(ISC_STATUS *,
  807.                                      isc_db_handle *,
  808.                                      ISC_LONG *,
  809.                                      short,
  810.                                      char *,
  811.                                      isc_callback,
  812.                                      void *);
  813.  
  814. ISC_STATUS ISC_EXPORT isc_rollback_retaining(ISC_STATUS *,
  815.                                              isc_tr_handle *);
  816.  
  817. ISC_STATUS ISC_EXPORT isc_rollback_transaction(ISC_STATUS *,
  818.                                                isc_tr_handle *);
  819.  
  820. ISC_STATUS ISC_EXPORT isc_start_multiple(ISC_STATUS *,
  821.                                          isc_tr_handle *,
  822.                                          short,
  823.                                          void *);
  824.  
  825. ISC_STATUS ISC_EXPORT_VARARG isc_start_transaction(ISC_STATUS *,
  826.                                                    isc_tr_handle *,
  827.                                                    short, ...);
  828.  
  829. ISC_LONG ISC_EXPORT isc_sqlcode(ISC_STATUS *);
  830.  
  831. void ISC_EXPORT isc_sql_interprete(short,
  832.                                    char *,
  833.                                    short);
  834.  
  835. ISC_STATUS ISC_EXPORT isc_transaction_info(ISC_STATUS *,
  836.                                            isc_tr_handle *,
  837.                                            short,
  838.                                            char *,
  839.                                            short,
  840.                                            char *);
  841.  
  842. ISC_STATUS ISC_EXPORT isc_transact_request(ISC_STATUS *,
  843.                                            isc_db_handle *,
  844.                                            isc_tr_handle *,
  845.                                            unsigned short,
  846.                                            char *,
  847.                                            unsigned short,
  848.                                            char *,
  849.                                            unsigned short,
  850.                                            char *);
  851.  
  852. ISC_LONG ISC_EXPORT isc_vax_integer(char *,
  853.                                     short);
  854.  
  855. ISC_INT64 ISC_EXPORT isc_portable_integer(unsigned char *,
  856.                                           short);
  857.  
  858. /*************************************/
  859. /* Security Functions and structures */
  860. /*************************************/
  861.  
  862. #define sec_uid_spec            0x01
  863. #define sec_gid_spec            0x02
  864. #define sec_server_spec            0x04
  865. #define sec_password_spec        0x08
  866. #define sec_group_name_spec        0x10
  867. #define sec_first_name_spec        0x20
  868. #define sec_middle_name_spec        0x40
  869. #define sec_last_name_spec        0x80
  870. #define sec_dba_user_name_spec      0x100
  871. #define sec_dba_password_spec       0x200
  872.  
  873. #define sec_protocol_tcpip            1
  874. #define sec_protocol_netbeui          2
  875. #define sec_protocol_spx              3 /* -- Deprecated Protocol. Declaration retained for compatibility   */
  876. #define sec_protocol_local            4
  877.  
  878. typedef struct {
  879.     short sec_flags;            /* which fields are specified */
  880.     int uid;                    /* the user's id */
  881.     int gid;                    /* the user's group id */
  882.     int protocol;                /* protocol to use for connection */
  883.     char *server;                /* server to administer */
  884.     char *user_name;            /* the user's name */
  885.     char *password;                /* the user's password */
  886.     char *group_name;            /* the group name */
  887.     char *first_name;            /* the user's first name */
  888.     char *middle_name;            /* the user's middle name */
  889.     char *last_name;            /* the user's last name */
  890.     char *dba_user_name;        /* the dba user name */
  891.     char *dba_password;            /* the dba password */
  892. } USER_SEC_DATA;
  893.  
  894. int ISC_EXPORT isc_add_user(ISC_STATUS *, USER_SEC_DATA *);
  895.  
  896. int ISC_EXPORT isc_delete_user(ISC_STATUS *, USER_SEC_DATA *);
  897.  
  898. int ISC_EXPORT isc_modify_user(ISC_STATUS *, USER_SEC_DATA *);
  899.  
  900. /**********************************/
  901. /*  Other OSRI functions          */
  902. /**********************************/
  903.  
  904. ISC_STATUS ISC_EXPORT isc_compile_request(ISC_STATUS *,
  905.                                           isc_db_handle *,
  906.                                           isc_req_handle *,
  907.                                           short,
  908.                                           char *);
  909.  
  910. ISC_STATUS ISC_EXPORT isc_compile_request2(ISC_STATUS *,
  911.                                            isc_db_handle *,
  912.                                            isc_req_handle *,
  913.                                            short,
  914.                                            char *);
  915.  
  916. ISC_STATUS ISC_EXPORT isc_ddl(ISC_STATUS *,
  917.                               isc_db_handle *,
  918.                               isc_tr_handle *,
  919.                               short,
  920.                               char *);
  921.  
  922. ISC_STATUS ISC_EXPORT isc_prepare_transaction(ISC_STATUS *,
  923.                                               isc_tr_handle *);
  924.  
  925.  
  926. ISC_STATUS ISC_EXPORT isc_receive(ISC_STATUS *,
  927.                                   isc_req_handle *,
  928.                                   short,
  929.                                   short,
  930.                                   void *,
  931.                                   short);
  932.  
  933. ISC_STATUS ISC_EXPORT isc_reconnect_transaction(ISC_STATUS *,
  934.                                                 isc_db_handle *,
  935.                                                 isc_tr_handle *,
  936.                                                 short,
  937.                                                 char *);
  938.  
  939. ISC_STATUS ISC_EXPORT isc_release_request(ISC_STATUS *,
  940.                                           isc_req_handle *);
  941.  
  942. ISC_STATUS ISC_EXPORT isc_request_info(ISC_STATUS *,
  943.                                        isc_req_handle *,
  944.                                        short,
  945.                                        short,
  946.                                        char *,
  947.                                        short,
  948.                                        char *);
  949.  
  950. ISC_STATUS ISC_EXPORT isc_seek_blob(ISC_STATUS *,
  951.                                     isc_blob_handle *,
  952.                                     short,
  953.                                     ISC_LONG,
  954.                                     ISC_LONG *);
  955.  
  956. ISC_STATUS ISC_EXPORT isc_send(ISC_STATUS *,
  957.                                isc_req_handle *,
  958.                                short,
  959.                                short,
  960.                                void *,
  961.                                short);
  962.  
  963. ISC_STATUS ISC_EXPORT isc_start_and_send(ISC_STATUS *,
  964.                                          isc_req_handle *,
  965.                                          isc_tr_handle *,
  966.                                          short,
  967.                                          short,
  968.                                          void *,
  969.                                          short);
  970.  
  971. ISC_STATUS ISC_EXPORT isc_start_request(ISC_STATUS *,
  972.                                         isc_req_handle *,
  973.                                         isc_tr_handle *,
  974.                                         short);
  975.  
  976. ISC_STATUS ISC_EXPORT isc_unwind_request(ISC_STATUS *,
  977.                                          isc_tr_handle *,
  978.                                          short);
  979.  
  980. ISC_STATUS ISC_EXPORT isc_wait_for_event(ISC_STATUS *,
  981.                                          isc_db_handle *,
  982.                                          short,
  983.                                          char *,
  984.                                          char *);
  985.  
  986.  
  987. /*****************************/
  988. /* Other Sql functions       */
  989. /*****************************/
  990.  
  991. ISC_STATUS ISC_EXPORT isc_close(ISC_STATUS *,
  992.                                 char *);
  993.  
  994. ISC_STATUS ISC_EXPORT isc_declare(ISC_STATUS *,
  995.                                   char *,
  996.                                   char *);
  997.  
  998. ISC_STATUS ISC_EXPORT isc_describe(ISC_STATUS *,
  999.                                    char *,
  1000.                                    XSQLDA *);
  1001.  
  1002. ISC_STATUS ISC_EXPORT isc_describe_bind(ISC_STATUS *,
  1003.                                         char *,
  1004.                                         XSQLDA *);
  1005.  
  1006. ISC_STATUS ISC_EXPORT isc_execute(ISC_STATUS *,
  1007.                                   isc_tr_handle *,
  1008.                                   char *,
  1009.                                   XSQLDA *);
  1010.  
  1011. ISC_STATUS ISC_EXPORT isc_execute_immediate(ISC_STATUS *,
  1012.                                             isc_db_handle *,
  1013.                                             isc_tr_handle *,
  1014.                                             short *,
  1015.                                             char *);
  1016.  
  1017. ISC_STATUS ISC_EXPORT isc_fetch(ISC_STATUS *,
  1018.                                 char *,
  1019.                                 XSQLDA *);
  1020.  
  1021. ISC_STATUS ISC_EXPORT isc_open(ISC_STATUS *,
  1022.                                isc_tr_handle *,
  1023.                                char *,
  1024.                                XSQLDA *);
  1025.  
  1026. ISC_STATUS ISC_EXPORT isc_prepare(ISC_STATUS *,
  1027.                                   isc_db_handle *,
  1028.                                   isc_tr_handle *,
  1029.                                   char *,
  1030.                                   short *,
  1031.                                   char *,
  1032.                                   XSQLDA *);
  1033.  
  1034.  
  1035. /*************************************/
  1036. /* Other Dynamic sql functions       */
  1037. /*************************************/
  1038.  
  1039. ISC_STATUS ISC_EXPORT isc_dsql_execute_m(ISC_STATUS *,
  1040.                                          isc_tr_handle *,
  1041.                                          isc_stmt_handle *,
  1042.                                          unsigned short,
  1043.                                          char *,
  1044.                                          unsigned short,
  1045.                                          unsigned short,
  1046.                                          char *);
  1047.  
  1048. ISC_STATUS ISC_EXPORT isc_dsql_execute2_m(ISC_STATUS *,
  1049.                                           isc_tr_handle *,
  1050.                                           isc_stmt_handle *,
  1051.                                           unsigned short,
  1052.                                           char *,
  1053.                                           unsigned short,
  1054.                                           unsigned short,
  1055.                                           char *,
  1056.                                           unsigned short,
  1057.                                           char *,
  1058.                                           unsigned short,
  1059.                                           unsigned short,
  1060.                                           char *);
  1061.  
  1062. ISC_STATUS ISC_EXPORT isc_dsql_execute_immediate_m(ISC_STATUS *,
  1063.                                                    isc_db_handle *,
  1064.                                                    isc_tr_handle *,
  1065.                                                    unsigned short,
  1066.                                                    char *,
  1067.                                                    unsigned short,
  1068.                                                    unsigned short,
  1069.                                                    char *,
  1070.                                                    unsigned short,
  1071.                                                    unsigned short,
  1072.                                                    char *);
  1073.  
  1074. ISC_STATUS ISC_EXPORT isc_dsql_exec_immed3_m(ISC_STATUS *,
  1075.                                              isc_db_handle *,
  1076.                                              isc_tr_handle *,
  1077.                                              unsigned short,
  1078.                                              char *,
  1079.                                              unsigned short,
  1080.                                              unsigned short,
  1081.                                              char *,
  1082.                                              unsigned short,
  1083.                                              unsigned short,
  1084.                                              char *,
  1085.                                              unsigned short,
  1086.                                              char *,
  1087.                                              unsigned short,
  1088.                                              unsigned short,
  1089.                                              char *);
  1090.  
  1091. ISC_STATUS ISC_EXPORT isc_dsql_fetch_m(ISC_STATUS *,
  1092.                                        isc_stmt_handle *,
  1093.                                        unsigned short,
  1094.                                        char *,
  1095.                                        unsigned short,
  1096.                                        unsigned short,
  1097.                                        char *);
  1098.  
  1099. ISC_STATUS ISC_EXPORT isc_dsql_insert_m(ISC_STATUS *,
  1100.                                         isc_stmt_handle *,
  1101.                                         unsigned short,
  1102.                                         char *,
  1103.                                         unsigned short,
  1104.                                         unsigned short,
  1105.                                         char *);
  1106.  
  1107. ISC_STATUS ISC_EXPORT isc_dsql_prepare_m(ISC_STATUS *,
  1108.                                          isc_tr_handle *,
  1109.                                          isc_stmt_handle *,
  1110.                                          unsigned short,
  1111.                                          char *,
  1112.                                          unsigned short,
  1113.                                          unsigned short,
  1114.                                          char *,
  1115.                                          unsigned short,
  1116.                                          char *);
  1117.  
  1118. ISC_STATUS ISC_EXPORT isc_dsql_release(ISC_STATUS *,
  1119.                                        char *);
  1120.  
  1121. ISC_STATUS ISC_EXPORT isc_embed_dsql_close(ISC_STATUS *,
  1122.                                            char *);
  1123.  
  1124. ISC_STATUS ISC_EXPORT isc_embed_dsql_declare(ISC_STATUS *,
  1125.                                              char *,
  1126.                                              char *);
  1127.  
  1128. ISC_STATUS ISC_EXPORT isc_embed_dsql_describe(ISC_STATUS *,
  1129.                                               char *,
  1130.                                               unsigned short,
  1131.                                               XSQLDA *);
  1132.  
  1133. ISC_STATUS ISC_EXPORT isc_embed_dsql_describe_bind(ISC_STATUS *,
  1134.                                                    char *,
  1135.                                                    unsigned short,
  1136.                                                    XSQLDA *);
  1137.  
  1138. ISC_STATUS ISC_EXPORT isc_embed_dsql_execute(ISC_STATUS *,
  1139.                                              isc_tr_handle *,
  1140.                                              char *,
  1141.                                              unsigned short,
  1142.                                              XSQLDA *);
  1143.  
  1144. ISC_STATUS ISC_EXPORT isc_embed_dsql_execute2(ISC_STATUS *,
  1145.                                               isc_tr_handle *,
  1146.                                               char *,
  1147.                                               unsigned short,
  1148.                                               XSQLDA *,
  1149.                                               XSQLDA *);
  1150.  
  1151. ISC_STATUS ISC_EXPORT isc_embed_dsql_execute_immed(ISC_STATUS *,
  1152.                                                    isc_db_handle *,
  1153.                                                    isc_tr_handle *,
  1154.                                                    unsigned short,
  1155.                                                    char *,
  1156.                                                    unsigned short,
  1157.                                                    XSQLDA *);
  1158.  
  1159. ISC_STATUS ISC_EXPORT isc_embed_dsql_fetch(ISC_STATUS *,
  1160.                                            char *,
  1161.                                            unsigned short,
  1162.                                            XSQLDA *);
  1163.  
  1164. ISC_STATUS ISC_EXPORT isc_embed_dsql_open(ISC_STATUS *,
  1165.                                           isc_tr_handle *,
  1166.                                           char *,
  1167.                                           unsigned short,
  1168.                                           XSQLDA *);
  1169.  
  1170. ISC_STATUS ISC_EXPORT isc_embed_dsql_open2(ISC_STATUS *,
  1171.                                            isc_tr_handle *,
  1172.                                            char *,
  1173.                                            unsigned short,
  1174.                                            XSQLDA *,
  1175.                                            XSQLDA *);
  1176.  
  1177. ISC_STATUS ISC_EXPORT isc_embed_dsql_insert(ISC_STATUS *,
  1178.                                             char *,
  1179.                                             unsigned short,
  1180.                                             XSQLDA *);
  1181.  
  1182. ISC_STATUS ISC_EXPORT isc_embed_dsql_prepare(ISC_STATUS *,
  1183.                                              isc_db_handle *,
  1184.                                              isc_tr_handle *,
  1185.                                              char *,
  1186.                                              unsigned short,
  1187.                                              char *,
  1188.                                              unsigned short,
  1189.                                              XSQLDA *);
  1190.  
  1191. ISC_STATUS ISC_EXPORT isc_embed_dsql_release(ISC_STATUS *,
  1192.                                              char *);
  1193.  
  1194.  
  1195. /******************************/
  1196. /* Other Blob functions       */
  1197. /******************************/
  1198.  
  1199. BSTREAM *ISC_EXPORT BLOB_open(isc_blob_handle,
  1200.                                       char *,
  1201.                                       int);
  1202.  
  1203. int ISC_EXPORT BLOB_put(char,
  1204.                         BSTREAM *);
  1205.  
  1206. int ISC_EXPORT BLOB_close(BSTREAM *);
  1207.  
  1208. int ISC_EXPORT BLOB_get(BSTREAM *);
  1209.  
  1210. int ISC_EXPORT BLOB_display(ISC_QUAD *,
  1211.                             isc_db_handle,
  1212.                             isc_tr_handle,
  1213.                             char *);
  1214.  
  1215. int ISC_EXPORT BLOB_dump(ISC_QUAD *,
  1216.                          isc_db_handle,
  1217.                          isc_tr_handle,
  1218.                          char *);
  1219.  
  1220. int ISC_EXPORT BLOB_edit(ISC_QUAD *,
  1221.                          isc_db_handle,
  1222.                          isc_tr_handle,
  1223.                          char *);
  1224.  
  1225. int ISC_EXPORT BLOB_load(ISC_QUAD *,
  1226.                          isc_db_handle,
  1227.                          isc_tr_handle,
  1228.                          char *);
  1229.  
  1230. int ISC_EXPORT BLOB_text_dump(ISC_QUAD *,
  1231.                               isc_db_handle,
  1232.                               isc_tr_handle,
  1233.                               char *);
  1234.  
  1235. int ISC_EXPORT BLOB_text_load(ISC_QUAD *,
  1236.                               isc_db_handle,
  1237.                               isc_tr_handle,
  1238.                               char *);
  1239.  
  1240. BSTREAM *ISC_EXPORT Bopen(ISC_QUAD *,
  1241.                                   isc_db_handle,
  1242.                                   isc_tr_handle,
  1243.                                   char *);
  1244.  
  1245. BSTREAM *ISC_EXPORT Bopen2(ISC_QUAD *,
  1246.                                    isc_db_handle,
  1247.                                    isc_tr_handle,
  1248.                                    char *,
  1249.                                    unsigned short);
  1250.  
  1251.  
  1252. /******************************/
  1253. /* Other Misc functions       */
  1254. /******************************/
  1255.  
  1256. ISC_LONG ISC_EXPORT isc_ftof(char *,
  1257.                              unsigned short,
  1258.                              char *,
  1259.                              unsigned short);
  1260.  
  1261. ISC_STATUS ISC_EXPORT isc_print_blr(char *,
  1262.                                     isc_callback,
  1263.                                     void *,
  1264.                                     short);
  1265.  
  1266. void ISC_EXPORT isc_set_debug(int);
  1267.  
  1268. void ISC_EXPORT isc_qtoq(ISC_QUAD *,
  1269.                          ISC_QUAD *);
  1270.  
  1271. void ISC_EXPORT isc_vtof(char *,
  1272.                          char *,
  1273.                          unsigned short);
  1274.  
  1275. void ISC_EXPORT isc_vtov(char *,
  1276.                          char *,
  1277.                          short);
  1278.  
  1279. int ISC_EXPORT isc_version(isc_db_handle *,
  1280.                            isc_callback,
  1281.                            void *);
  1282.  
  1283. ISC_LONG ISC_EXPORT isc_reset_fpe(unsigned short);
  1284.  
  1285.  
  1286. /*****************************************/
  1287. /* Service manager functions             */
  1288. /*****************************************/
  1289.  
  1290. #define ADD_SPB_LENGTH(p, length)    {*(p)++ = (length); \
  1291.                          *(p)++ = (length) >> 8;}
  1292.  
  1293. #define ADD_SPB_NUMERIC(p, data)    {*(p)++ = (SCHAR) (data); \
  1294.                          *(p)++ = (SCHAR) ((data) >> 8); \
  1295.                      *(p)++ = (SCHAR) ((data) >> 16); \
  1296.                      *(p)++ = (SCHAR) ((data) >> 24);}
  1297.  
  1298. ISC_STATUS ISC_EXPORT isc_service_attach(ISC_STATUS *,
  1299.                                          unsigned short,
  1300.                                          char *,
  1301.                                          isc_svc_handle *,
  1302.                                          unsigned short,
  1303.                                          char *);
  1304.  
  1305. ISC_STATUS ISC_EXPORT isc_service_detach(ISC_STATUS *,
  1306.                                          isc_svc_handle *);
  1307.  
  1308. ISC_STATUS ISC_EXPORT isc_service_query(ISC_STATUS *,
  1309.                                         isc_svc_handle *,
  1310.                                         isc_resv_handle *,
  1311.                                         unsigned short,
  1312.                                         char *,
  1313.                                         unsigned short,
  1314.                                         char *,
  1315.                                         unsigned short,
  1316.                                         char *);
  1317.  
  1318. ISC_STATUS ISC_EXPORT isc_service_start(ISC_STATUS *,
  1319.                                         isc_svc_handle *,
  1320.                                         isc_resv_handle *,
  1321.                                         unsigned short,
  1322.                                         char *);
  1323.  
  1324.  
  1325. /********************************/
  1326. /* Client information functions */
  1327. /********************************/
  1328.  
  1329. void ISC_EXPORT isc_get_client_version ( char  *);
  1330. int  ISC_EXPORT isc_get_client_major_version ();
  1331. int  ISC_EXPORT isc_get_client_minor_version ();
  1332.  
  1333. #ifdef __cplusplus
  1334. }    /* extern "C" */
  1335. #endif
  1336.  
  1337.  
  1338. /***************************************************/
  1339. /* Actions to pass to the blob filter (ctl_source) */
  1340. /***************************************************/
  1341.  
  1342. #define isc_blob_filter_open             0
  1343. #define isc_blob_filter_get_segment      1
  1344. #define isc_blob_filter_close            2
  1345. #define isc_blob_filter_create           3
  1346. #define isc_blob_filter_put_segment      4
  1347. #define isc_blob_filter_alloc            5
  1348. #define isc_blob_filter_free             6
  1349. #define isc_blob_filter_seek             7
  1350.  
  1351. /*******************/
  1352. /* Blr definitions */
  1353. /*******************/
  1354.  
  1355.  
  1356. /*  WARNING: if you add a new BLR representing a data type, and the value
  1357.  *           is greater than the numerically greatest value which now
  1358.  *           represents a data type, you must change the define for
  1359.  *           DTYPE_BLR_MAX in jrd/align.h, and add the necessary entries
  1360.  *           to all the arrays in that file.
  1361.  */
  1362.  
  1363. #define blr_text        (unsigned char)14
  1364. #define blr_text2        (unsigned char)15    /* added in 3.2 JPN */
  1365. #define blr_short        (unsigned char)7
  1366. #define blr_long        (unsigned char)8
  1367. #define blr_quad        (unsigned char)9
  1368. #define blr_float        (unsigned char)10
  1369. #define blr_double        (unsigned char)27
  1370. #define blr_d_float        (unsigned char)11
  1371. #define blr_timestamp        (unsigned char)35
  1372. #define blr_varying        (unsigned char)37
  1373. #define blr_varying2        (unsigned char)38    /* added in 3.2 JPN */
  1374. #define blr_blob        (unsigned short)261
  1375. #define blr_cstring        (unsigned char)40         
  1376. #define blr_cstring2        (unsigned char)41    /* added in 3.2 JPN */
  1377. #define blr_blob_id         (unsigned char)45    /* added from gds.h */
  1378. #define blr_sql_date        (unsigned char)12
  1379. #define blr_sql_time        (unsigned char)13
  1380. #define blr_int64               (unsigned char)16
  1381.  
  1382. /* Historical alias for pre V6 applications */
  1383. #define blr_date        blr_timestamp
  1384.  
  1385. #define blr_inner        (unsigned char)0
  1386. #define blr_left        (unsigned char)1
  1387. #define blr_right        (unsigned char)2
  1388. #define blr_full        (unsigned char)3
  1389.  
  1390. #define blr_gds_code        (unsigned char)0
  1391. #define blr_sql_code        (unsigned char)1
  1392. #define blr_exception        (unsigned char)2
  1393. #define blr_trigger_code     (unsigned char)3
  1394. #define blr_default_code     (unsigned char)4
  1395. #define blr_raise            (unsigned char)5
  1396. #define blr_exception_msg    (unsigned char)6
  1397.  
  1398. #define blr_version4        (unsigned char)4
  1399. #define blr_version5        (unsigned char)5
  1400. #define blr_eoc            (unsigned char)76
  1401. #define blr_end            (unsigned char)255    /* note: defined as -1 in gds.h */
  1402.  
  1403. #define blr_assignment        (unsigned char)1
  1404. #define blr_begin        (unsigned char)2
  1405. #define blr_dcl_variable      (unsigned char)3    /* added from gds.h */
  1406. #define blr_message        (unsigned char)4
  1407. #define blr_erase        (unsigned char)5
  1408. #define blr_fetch        (unsigned char)6
  1409. #define blr_for            (unsigned char)7
  1410. #define blr_if            (unsigned char)8
  1411. #define blr_loop        (unsigned char)9
  1412. #define blr_modify        (unsigned char)10
  1413. #define blr_handler        (unsigned char)11
  1414. #define blr_receive        (unsigned char)12
  1415. #define blr_select        (unsigned char)13
  1416. #define blr_send        (unsigned char)14
  1417. #define blr_store        (unsigned char)15
  1418. #define blr_label        (unsigned char)17
  1419. #define blr_leave        (unsigned char)18
  1420. #define blr_store2        (unsigned char)19
  1421. #define blr_post                (unsigned char)20
  1422. #define blr_literal        (unsigned char)21
  1423. #define blr_dbkey        (unsigned char)22
  1424. #define blr_field        (unsigned char)23
  1425. #define blr_fid            (unsigned char)24
  1426. #define blr_parameter        (unsigned char)25
  1427. #define blr_variable        (unsigned char)26
  1428. #define blr_average        (unsigned char)27
  1429. #define blr_count        (unsigned char)28
  1430. #define blr_maximum        (unsigned char)29
  1431. #define blr_minimum        (unsigned char)30
  1432. #define blr_total        (unsigned char)31
  1433. /* count 2
  1434. #define blr_count2        32
  1435. */
  1436. #define blr_add            (unsigned char)34
  1437. #define blr_subtract        (unsigned char)35
  1438. #define blr_multiply        (unsigned char)36
  1439. #define blr_divide        (unsigned char)37
  1440. #define blr_negate        (unsigned char)38
  1441. #define blr_concatenate        (unsigned char)39
  1442. #define blr_substring        (unsigned char)40
  1443. #define blr_parameter2        (unsigned char)41
  1444. #define blr_from        (unsigned char)42
  1445. #define blr_via            (unsigned char)43
  1446. #define blr_parameter2_old    (unsigned char)44    /* Confusion */
  1447. #define blr_user_name       (unsigned char)44    /* added from gds.h */
  1448. #define blr_null        (unsigned char)45
  1449.  
  1450. #define blr_eql            (unsigned char)47
  1451. #define blr_neq            (unsigned char)48
  1452. #define blr_gtr            (unsigned char)49
  1453. #define blr_geq            (unsigned char)50
  1454. #define blr_lss            (unsigned char)51
  1455. #define blr_leq            (unsigned char)52
  1456. #define blr_containing        (unsigned char)53
  1457. #define blr_matching        (unsigned char)54
  1458. #define blr_starting        (unsigned char)55
  1459. #define blr_between        (unsigned char)56
  1460. #define blr_or            (unsigned char)57
  1461. #define blr_and            (unsigned char)58
  1462. #define blr_not            (unsigned char)59
  1463. #define blr_any            (unsigned char)60
  1464. #define blr_missing        (unsigned char)61
  1465. #define blr_unique        (unsigned char)62
  1466. #define blr_like        (unsigned char)63
  1467.  
  1468. #define blr_stream          (unsigned char)65    /* added from gds.h */
  1469. #define blr_set_index       (unsigned char)66    /* added from gds.h */
  1470.  
  1471. #define blr_rse            (unsigned char)67
  1472. #define blr_first        (unsigned char)68
  1473. #define blr_project        (unsigned char)69
  1474. #define blr_sort        (unsigned char)70
  1475. #define blr_boolean        (unsigned char)71
  1476. #define blr_ascending        (unsigned char)72
  1477. #define blr_descending        (unsigned char)73
  1478. #define blr_relation        (unsigned char)74
  1479. #define blr_rid            (unsigned char)75
  1480. #define blr_union        (unsigned char)76
  1481. #define blr_map            (unsigned char)77
  1482. #define blr_group_by        (unsigned char)78
  1483. #define blr_aggregate        (unsigned char)79
  1484. #define blr_join_type        (unsigned char)80
  1485.  
  1486. #define blr_agg_count        (unsigned char)83
  1487. #define blr_agg_max        (unsigned char)84
  1488. #define blr_agg_min        (unsigned char)85
  1489. #define blr_agg_total        (unsigned char)86
  1490. #define blr_agg_average        (unsigned char)87
  1491. #define    blr_parameter3        (unsigned char)88    /* same as Rdb definition */
  1492. #define blr_run_max        (unsigned char)89
  1493. #define blr_run_min        (unsigned char)90
  1494. #define blr_run_total        (unsigned char)91
  1495. #define blr_run_average        (unsigned char)92
  1496. #define blr_agg_count2        (unsigned char)93
  1497. #define blr_agg_count_distinct    (unsigned char)94
  1498. #define blr_agg_total_distinct    (unsigned char)95
  1499. #define blr_agg_average_distinct (unsigned char)96
  1500.  
  1501. #define blr_function        (unsigned char)100
  1502. #define blr_gen_id        (unsigned char)101
  1503. #define blr_prot_mask        (unsigned char)102
  1504. #define blr_upcase        (unsigned char)103
  1505. #define blr_lock_state        (unsigned char)104
  1506. #define blr_value_if        (unsigned char)105
  1507. #define blr_matching2        (unsigned char)106
  1508. #define blr_index        (unsigned char)107
  1509. #define blr_ansi_like        (unsigned char)108
  1510. #define blr_bookmark        (unsigned char)109
  1511. #define blr_crack        (unsigned char)110
  1512. #define blr_force_crack        (unsigned char)111
  1513. #define blr_seek        (unsigned char)112
  1514. #define blr_find        (unsigned char)113
  1515.                                  
  1516. /* these indicate directions for blr_seek and blr_find */
  1517.  
  1518. #define blr_continue        (unsigned char)0
  1519. #define blr_forward        (unsigned char)1
  1520. #define blr_backward        (unsigned char)2
  1521. #define blr_bof_forward        (unsigned char)3
  1522. #define blr_eof_backward    (unsigned char)4
  1523.  
  1524. #define blr_lock_relation     (unsigned char)114
  1525. #define blr_lock_record        (unsigned char)115
  1526. #define blr_set_bookmark     (unsigned char)116
  1527. #define blr_get_bookmark     (unsigned char)117
  1528.  
  1529. #define blr_run_count        (unsigned char)118    /* changed from 88 to avoid conflict with blr_parameter3 */
  1530. #define blr_rs_stream        (unsigned char)119
  1531. #define blr_exec_proc        (unsigned char)120
  1532. #define blr_begin_range     (unsigned char)121
  1533. #define blr_end_range         (unsigned char)122
  1534. #define blr_delete_range     (unsigned char)123
  1535. #define blr_procedure        (unsigned char)124
  1536. #define blr_pid            (unsigned char)125
  1537. #define blr_exec_pid        (unsigned char)126
  1538. #define blr_singular        (unsigned char)127
  1539. #define blr_abort        (unsigned char)128
  1540. #define blr_block         (unsigned char)129
  1541. #define blr_error_handler    (unsigned char)130
  1542.  
  1543. #define blr_cast        (unsigned char)131
  1544. #define blr_release_lock    (unsigned char)132
  1545. #define blr_release_locks    (unsigned char)133
  1546. #define blr_start_savepoint    (unsigned char)134
  1547. #define blr_end_savepoint    (unsigned char)135
  1548. #define blr_find_dbkey        (unsigned char)136
  1549. #define blr_range_relation    (unsigned char)137
  1550. #define blr_delete_ranges    (unsigned char)138
  1551.  
  1552. #define blr_plan        (unsigned char)139    /* access plan items */
  1553. #define blr_merge        (unsigned char)140
  1554. #define blr_join        (unsigned char)141
  1555. #define blr_sequential        (unsigned char)142
  1556. #define blr_navigational    (unsigned char)143
  1557. #define blr_indices        (unsigned char)144
  1558. #define blr_retrieve        (unsigned char)145
  1559.  
  1560. #define blr_relation2        (unsigned char)146
  1561. #define blr_rid2        (unsigned char)147
  1562. #define blr_reset_stream    (unsigned char)148
  1563. #define blr_release_bookmark    (unsigned char)149
  1564.  
  1565. #define blr_set_generator       (unsigned char)150
  1566.  
  1567. #define blr_ansi_any        (unsigned char)151   /* required for NULL handling */
  1568. #define blr_exists        (unsigned char)152   /* required for NULL handling */
  1569. #define blr_cardinality        (unsigned char)153
  1570.  
  1571. #define blr_record_version    (unsigned char)154    /* get tid of record */
  1572. #define blr_stall        (unsigned char)155    /* fake server stall */
  1573.  
  1574. #define blr_seek_no_warn    (unsigned char)156    
  1575. #define blr_find_dbkey_version    (unsigned char)157   /* find dbkey with record version */
  1576. #define blr_ansi_all        (unsigned char)158   /* required for NULL handling */
  1577.  
  1578. #define blr_extract        (unsigned char)159
  1579.  
  1580. /* sub parameters for blr_extract */
  1581.  
  1582. #define blr_extract_year    (unsigned char)0
  1583. #define blr_extract_month    (unsigned char)1
  1584. #define blr_extract_day        (unsigned char)2
  1585. #define blr_extract_hour    (unsigned char)3
  1586. #define blr_extract_minute    (unsigned char)4
  1587. #define blr_extract_second    (unsigned char)5
  1588. #define blr_extract_weekday    (unsigned char)6
  1589. #define blr_extract_yearday    (unsigned char)7
  1590.  
  1591. #define blr_current_date    (unsigned char)160
  1592. #define blr_current_timestamp    (unsigned char)161
  1593. #define blr_current_time    (unsigned char)162
  1594.  
  1595. /* FB 1.0 specific BLR */
  1596.  
  1597. #define blr_current_role    (unsigned char)174
  1598. #define blr_skip        (unsigned char)175
  1599.  
  1600. /* FB 1.5 specific BLR */
  1601.  
  1602. #define blr_exec_sql        (unsigned char)176
  1603. #define blr_internal_info    (unsigned char)177
  1604. #define blr_nullsfirst        (unsigned char)178
  1605. #define blr_writelock        (unsigned char)179
  1606. #define blr_nullslast       (unsigned char)180
  1607.  
  1608. /* These codes reuse BLR code space */
  1609.  
  1610. #define blr_post_arg        (unsigned char)163
  1611. #define blr_exec_into        (unsigned char)164
  1612. #define blr_user_savepoint    (unsigned char)165
  1613.  
  1614. /* These codes are actions for user-defined savepoints */
  1615.  
  1616. #define blr_savepoint_set    (unsigned char)0
  1617. #define blr_savepoint_release    (unsigned char)1
  1618. #define blr_savepoint_undo    (unsigned char)2
  1619. #define blr_savepoint_release_single    (unsigned char)3
  1620.  
  1621.  
  1622. /**********************************/
  1623. /* Database parameter block stuff */
  1624. /**********************************/
  1625.  
  1626. #define isc_dpb_version1                  1
  1627. #define isc_dpb_cdd_pathname              1
  1628. #define isc_dpb_allocation                2
  1629. #define isc_dpb_journal                   3
  1630. #define isc_dpb_page_size                 4
  1631. #define isc_dpb_num_buffers               5
  1632. #define isc_dpb_buffer_length             6
  1633. #define isc_dpb_debug                     7
  1634. #define isc_dpb_garbage_collect           8
  1635. #define isc_dpb_verify                    9
  1636. #define isc_dpb_sweep                     10
  1637. #define isc_dpb_enable_journal            11
  1638. #define isc_dpb_disable_journal           12
  1639. #define isc_dpb_dbkey_scope               13
  1640. #define isc_dpb_number_of_users           14
  1641. #define isc_dpb_trace                     15
  1642. #define isc_dpb_no_garbage_collect        16
  1643. #define isc_dpb_damaged                   17
  1644. #define isc_dpb_license                   18
  1645. #define isc_dpb_sys_user_name             19
  1646. #define isc_dpb_encrypt_key               20
  1647. #define isc_dpb_activate_shadow           21
  1648. #define isc_dpb_sweep_interval            22
  1649. #define isc_dpb_delete_shadow             23
  1650. #define isc_dpb_force_write               24
  1651. #define isc_dpb_begin_log                 25
  1652. #define isc_dpb_quit_log                  26
  1653. #define isc_dpb_no_reserve                27
  1654. #define isc_dpb_user_name                 28
  1655. #define isc_dpb_password                  29
  1656. #define isc_dpb_password_enc              30
  1657. #define isc_dpb_sys_user_name_enc         31
  1658. #define isc_dpb_interp                    32
  1659. #define isc_dpb_online_dump               33
  1660. #define isc_dpb_old_file_size             34
  1661. #define isc_dpb_old_num_files             35
  1662. #define isc_dpb_old_file                  36
  1663. #define isc_dpb_old_start_page            37
  1664. #define isc_dpb_old_start_seqno           38
  1665. #define isc_dpb_old_start_file            39
  1666. #define isc_dpb_drop_walfile              40
  1667. #define isc_dpb_old_dump_id               41
  1668. #define isc_dpb_wal_backup_dir            42
  1669. #define isc_dpb_wal_chkptlen              43
  1670. #define isc_dpb_wal_numbufs               44
  1671. #define isc_dpb_wal_bufsize               45
  1672. #define isc_dpb_wal_grp_cmt_wait          46
  1673. #define isc_dpb_lc_messages               47
  1674. #define isc_dpb_lc_ctype                  48
  1675. #define isc_dpb_cache_manager          49
  1676. #define isc_dpb_shutdown          50
  1677. #define isc_dpb_online              51
  1678. #define isc_dpb_shutdown_delay          52
  1679. #define isc_dpb_reserved          53
  1680. #define isc_dpb_overwrite          54
  1681. #define isc_dpb_sec_attach          55
  1682. #define isc_dpb_disable_wal          56
  1683. #define isc_dpb_connect_timeout           57
  1684. #define isc_dpb_dummy_packet_interval     58
  1685. #define isc_dpb_gbak_attach               59
  1686. #define isc_dpb_sql_role_name             60
  1687. #define isc_dpb_set_page_buffers          61
  1688. #define isc_dpb_working_directory         62
  1689. #define isc_dpb_sql_dialect               63
  1690. #define isc_dpb_set_db_readonly           64
  1691. #define isc_dpb_set_db_sql_dialect        65
  1692. #define isc_dpb_gfix_attach          66
  1693. #define isc_dpb_gstat_attach          67
  1694. #define isc_dpb_set_db_charset            68
  1695.  
  1696. /*********************************/
  1697. /* isc_dpb_verify specific flags */
  1698. /*********************************/
  1699.  
  1700. #define isc_dpb_pages                     1
  1701. #define isc_dpb_records                   2
  1702. #define isc_dpb_indices                   4
  1703. #define isc_dpb_transactions              8
  1704. #define isc_dpb_no_update                 16
  1705. #define isc_dpb_repair                    32
  1706. #define isc_dpb_ignore                    64
  1707.  
  1708. /***********************************/
  1709. /* isc_dpb_shutdown specific flags */
  1710. /***********************************/
  1711.  
  1712. #define isc_dpb_shut_cache               1
  1713. #define isc_dpb_shut_attachment          2
  1714. #define isc_dpb_shut_transaction         4
  1715. #define isc_dpb_shut_force               8
  1716.  
  1717. /**************************************/
  1718. /* Bit assignments in RDB$SYSTEM_FLAG */
  1719. /**************************************/
  1720.  
  1721. #define RDB_system                         1
  1722. #define RDB_id_assigned                    2
  1723.  
  1724.  
  1725. /*************************************/
  1726. /* Transaction parameter block stuff */
  1727. /*************************************/
  1728.  
  1729. #define isc_tpb_version1                  1
  1730. #define isc_tpb_version3                  3
  1731. #define isc_tpb_consistency               1
  1732. #define isc_tpb_concurrency               2
  1733. #define isc_tpb_shared                    3
  1734. #define isc_tpb_protected                 4
  1735. #define isc_tpb_exclusive                 5
  1736. #define isc_tpb_wait                      6
  1737. #define isc_tpb_nowait                    7
  1738. #define isc_tpb_read                      8
  1739. #define isc_tpb_write                     9
  1740. #define isc_tpb_lock_read                 10
  1741. #define isc_tpb_lock_write                11
  1742. #define isc_tpb_verb_time                 12
  1743. #define isc_tpb_commit_time               13
  1744. #define isc_tpb_ignore_limbo              14
  1745. #define isc_tpb_read_committed          15
  1746. #define isc_tpb_autocommit          16
  1747. #define isc_tpb_rec_version          17
  1748. #define isc_tpb_no_rec_version          18
  1749. #define isc_tpb_restart_requests      19
  1750. #define isc_tpb_no_auto_undo              20
  1751.  
  1752.  
  1753. /************************/
  1754. /* Blob Parameter Block */
  1755. /************************/
  1756.  
  1757. #define isc_bpb_version1                  1
  1758. #define isc_bpb_source_type               1
  1759. #define isc_bpb_target_type               2
  1760. #define isc_bpb_type                      3
  1761. #define isc_bpb_source_interp             4
  1762. #define isc_bpb_target_interp             5
  1763. #define isc_bpb_filter_parameter          6
  1764.  
  1765. #define isc_bpb_type_segmented            0
  1766. #define isc_bpb_type_stream               1
  1767.  
  1768.  
  1769. /*********************************/
  1770. /* Service parameter block stuff */
  1771. /*********************************/
  1772.  
  1773. #define isc_spb_version1                  1
  1774. #define isc_spb_current_version           2
  1775. #define isc_spb_version              isc_spb_current_version
  1776. #define isc_spb_user_name                 isc_dpb_user_name
  1777. #define isc_spb_sys_user_name             isc_dpb_sys_user_name
  1778. #define isc_spb_sys_user_name_enc         isc_dpb_sys_user_name_enc
  1779. #define isc_spb_password                  isc_dpb_password
  1780. #define isc_spb_password_enc              isc_dpb_password_enc
  1781. #define isc_spb_command_line              105
  1782. #define isc_spb_dbname                    106
  1783. #define isc_spb_verbose                   107
  1784. #define isc_spb_options                   108
  1785.  
  1786. #define isc_spb_connect_timeout           isc_dpb_connect_timeout
  1787. #define isc_spb_dummy_packet_interval     isc_dpb_dummy_packet_interval
  1788. #define isc_spb_sql_role_name             isc_dpb_sql_role_name
  1789.  
  1790.  
  1791. /*********************************/
  1792. /* Information call declarations */
  1793. /*********************************/
  1794.  
  1795. /****************************/
  1796. /* Common, structural codes */
  1797. /****************************/
  1798.  
  1799. #define isc_info_end                      1
  1800. #define isc_info_truncated                2
  1801. #define isc_info_error                    3
  1802. #define isc_info_data_not_ready              4
  1803. #define isc_info_flag_end          127
  1804.  
  1805. /******************************/
  1806. /* Database information items */
  1807. /******************************/
  1808.  
  1809. enum db_info_types
  1810.     {
  1811.     isc_info_db_id = 4,
  1812.     isc_info_reads = 5,
  1813.     isc_info_writes = 6,
  1814.     isc_info_fetches = 7,
  1815.     isc_info_marks = 8,
  1816.  
  1817.     isc_info_implementation = 11,
  1818.     isc_info_isc_version = 12,
  1819.     isc_info_base_level = 13,
  1820.     isc_info_page_size = 14,
  1821.     isc_info_num_buffers = 15,
  1822.     isc_info_limbo = 16,
  1823.     isc_info_current_memory = 17,
  1824.     isc_info_max_memory = 18,
  1825.     isc_info_window_turns = 19,
  1826.     isc_info_license = 20,   
  1827.  
  1828.     isc_info_allocation = 21,
  1829.     isc_info_attachment_id = 22,
  1830.     isc_info_read_seq_count = 23,
  1831.     isc_info_read_idx_count = 24,
  1832.     isc_info_insert_count = 25,
  1833.     isc_info_update_count = 26,
  1834.     isc_info_delete_count = 27,
  1835.     isc_info_backout_count = 28,
  1836.     isc_info_purge_count = 29,
  1837.     isc_info_expunge_count = 30, 
  1838.  
  1839.     isc_info_sweep_interval = 31,
  1840.     isc_info_ods_version = 32,
  1841.     isc_info_ods_minor_version = 33,
  1842.     isc_info_no_reserve = 34,
  1843.     isc_info_logfile = 35,
  1844.     isc_info_cur_logfile_name = 36,
  1845.     isc_info_cur_log_part_offset = 37,
  1846.     isc_info_num_wal_buffers = 38,
  1847.     isc_info_wal_buffer_size = 39,
  1848.     isc_info_wal_ckpt_length = 40,   
  1849.  
  1850.     isc_info_wal_cur_ckpt_interval = 41,  
  1851.     isc_info_wal_prv_ckpt_fname = 42,
  1852.     isc_info_wal_prv_ckpt_poffset = 43,
  1853.     isc_info_wal_recv_ckpt_fname = 44,
  1854.     isc_info_wal_recv_ckpt_poffset = 45,
  1855.     isc_info_wal_grpc_wait_usecs = 47,
  1856.     isc_info_wal_num_io = 48,
  1857.     isc_info_wal_avg_io_size = 49,
  1858.     isc_info_wal_num_commits = 50,  
  1859.  
  1860.     isc_info_wal_avg_grpc_size = 51,
  1861.     isc_info_forced_writes = 52,
  1862.     isc_info_user_names = 53,
  1863.     isc_info_page_errors = 54,
  1864.     isc_info_record_errors = 55,
  1865.     isc_info_bpage_errors = 56,
  1866.     isc_info_dpage_errors = 57,
  1867.     isc_info_ipage_errors = 58,
  1868.     isc_info_ppage_errors = 59,
  1869.     isc_info_tpage_errors = 60,
  1870.  
  1871.     isc_info_set_page_buffers = 61,
  1872.     isc_info_db_sql_dialect = 62,   
  1873.     isc_info_db_read_only = 63,
  1874.     isc_info_db_size_in_pages = 64,
  1875.  
  1876.     /* Values 65 -100 unused to avoid conflict with InterBase */
  1877.     
  1878.     frb_info_att_charset = 101,
  1879.     isc_info_db_class = 102,
  1880.     isc_info_firebird_version = 103,
  1881.     isc_info_oldest_transaction = 104,
  1882.     isc_info_oldest_active = 105,
  1883.     isc_info_oldest_snapshot = 106,
  1884.     isc_info_next_transaction = 107,
  1885.     isc_info_db_provider = 108,
  1886.     isc_info_active_transactions = 109,
  1887.  
  1888.     isc_info_db_last_value   /* Leave this LAST! */
  1889.     };
  1890.  
  1891. #define isc_info_version isc_info_isc_version
  1892.  
  1893.  
  1894. /**************************************/
  1895. /* Database information return values */
  1896. /**************************************/
  1897.  
  1898. enum  info_db_implementations
  1899.     {
  1900.     isc_info_db_impl_rdb_vms = 1,
  1901.     isc_info_db_impl_rdb_eln = 2,
  1902.     isc_info_db_impl_rdb_eln_dev = 3,
  1903.     isc_info_db_impl_rdb_vms_y = 4,
  1904.     isc_info_db_impl_rdb_eln_y = 5,
  1905.     isc_info_db_impl_jri = 6,
  1906.     isc_info_db_impl_jsv = 7,
  1907.  
  1908.     isc_info_db_impl_isc_apl_68K = 25,
  1909.     isc_info_db_impl_isc_vax_ultr = 26,
  1910.     isc_info_db_impl_isc_vms = 27,
  1911.     isc_info_db_impl_isc_sun_68k = 28,
  1912.     isc_info_db_impl_isc_os2 = 29,
  1913.     isc_info_db_impl_isc_sun4 = 30,       /* 30 */
  1914.     
  1915.     isc_info_db_impl_isc_hp_ux = 31,
  1916.     isc_info_db_impl_isc_sun_386i = 32,
  1917.     isc_info_db_impl_isc_vms_orcl = 33,
  1918.     isc_info_db_impl_isc_mac_aux = 34,
  1919.     isc_info_db_impl_isc_rt_aix = 35,
  1920.     isc_info_db_impl_isc_mips_ult = 36,
  1921.     isc_info_db_impl_isc_xenix = 37,
  1922.     isc_info_db_impl_isc_dg = 38,
  1923.     isc_info_db_impl_isc_hp_mpexl = 39,
  1924.     isc_info_db_impl_isc_hp_ux68K = 40,      /* 40 */
  1925.  
  1926.     isc_info_db_impl_isc_sgi = 41,
  1927.     isc_info_db_impl_isc_sco_unix = 42,
  1928.     isc_info_db_impl_isc_cray = 43,
  1929.     isc_info_db_impl_isc_imp = 44,
  1930.     isc_info_db_impl_isc_delta = 45,
  1931.     isc_info_db_impl_isc_next = 46,
  1932.     isc_info_db_impl_isc_dos = 47,
  1933.     isc_info_db_impl_m88K = 48,
  1934.     isc_info_db_impl_unixware = 49,
  1935.     isc_info_db_impl_isc_winnt_x86 = 50,
  1936.  
  1937.     isc_info_db_impl_isc_epson = 51,
  1938.     isc_info_db_impl_alpha_osf = 52,
  1939.     isc_info_db_impl_alpha_vms = 53,
  1940.     isc_info_db_impl_netware_386 = 54, 
  1941.     isc_info_db_impl_win_only = 55,
  1942.     isc_info_db_impl_ncr_3000 = 56,
  1943.     isc_info_db_impl_winnt_ppc = 57,
  1944.     isc_info_db_impl_dg_x86 = 58,
  1945.     isc_info_db_impl_sco_ev = 59,
  1946.     isc_info_db_impl_i386 = 60,
  1947.  
  1948.     isc_info_db_impl_freebsd = 61,
  1949.     isc_info_db_impl_netbsd = 62,
  1950.     isc_info_db_impl_darwin = 63,
  1951.     isc_info_db_impl_sinixz = 64,
  1952.  
  1953.     isc_info_db_impl_linux_sparc = 65,
  1954.  
  1955.     isc_info_db_impl_last_value   /* Leave this LAST! */
  1956.     };
  1957.  
  1958. #define isc_info_db_impl_isc_a            isc_info_db_impl_isc_apl_68K
  1959. #define isc_info_db_impl_isc_u            isc_info_db_impl_isc_vax_ultr
  1960. #define isc_info_db_impl_isc_v            isc_info_db_impl_isc_vms
  1961. #define isc_info_db_impl_isc_s            isc_info_db_impl_isc_sun_68k
  1962.  
  1963.  
  1964. enum info_db_class
  1965.     {
  1966.     isc_info_db_class_access = 1,
  1967.     isc_info_db_class_y_valve = 2,
  1968.     isc_info_db_class_rem_int = 3,
  1969.     isc_info_db_class_rem_srvr = 4,
  1970.     isc_info_db_class_pipe_int = 7,
  1971.     isc_info_db_class_pipe_srvr = 8,
  1972.     isc_info_db_class_sam_int = 9,
  1973.     isc_info_db_class_sam_srvr = 10,
  1974.     isc_info_db_class_gateway = 11,
  1975.     isc_info_db_class_cache = 12,
  1976.     isc_info_db_class_classic_access = 13,
  1977.     isc_info_db_class_server_access = 14,
  1978.  
  1979.     isc_info_db_class_last_value   /* Leave this LAST! */
  1980.     };
  1981.  
  1982. enum info_db_provider
  1983.     {
  1984.     isc_info_db_code_rdb_eln = 1,
  1985.     isc_info_db_code_rdb_vms = 2,
  1986.     isc_info_db_code_interbase = 3,
  1987.     isc_info_db_code_firebird = 4,
  1988.  
  1989.     isc_info_db_code_last_value   /* Leave this LAST! */
  1990.     };
  1991.  
  1992.  
  1993. /*****************************/
  1994. /* Request information items */
  1995. /*****************************/
  1996.  
  1997. #define isc_info_number_messages          4
  1998. #define isc_info_max_message              5
  1999. #define isc_info_max_send                 6
  2000. #define isc_info_max_receive              7
  2001. #define isc_info_state                    8
  2002. #define isc_info_message_number           9
  2003. #define isc_info_message_size             10
  2004. #define isc_info_request_cost             11
  2005. #define isc_info_access_path              12
  2006. #define isc_info_req_select_count         13
  2007. #define isc_info_req_insert_count         14
  2008. #define isc_info_req_update_count         15
  2009. #define isc_info_req_delete_count         16
  2010.  
  2011.  
  2012. /*********************/
  2013. /* Access path items */
  2014. /*********************/
  2015.  
  2016. #define isc_info_rsb_end           0
  2017. #define isc_info_rsb_begin           1
  2018. #define isc_info_rsb_type           2
  2019. #define isc_info_rsb_relation           3
  2020. #define isc_info_rsb_plan                  4
  2021.  
  2022. /*************/
  2023. /* Rsb types */
  2024. /*************/
  2025.  
  2026. #define isc_info_rsb_unknown           1
  2027. #define isc_info_rsb_indexed           2
  2028. #define isc_info_rsb_navigate           3
  2029. #define isc_info_rsb_sequential            4
  2030. #define isc_info_rsb_cross           5
  2031. #define isc_info_rsb_sort           6
  2032. #define isc_info_rsb_first           7
  2033. #define isc_info_rsb_boolean           8
  2034. #define isc_info_rsb_union           9
  2035. #define isc_info_rsb_aggregate          10
  2036. #define isc_info_rsb_merge          11
  2037. #define isc_info_rsb_ext_sequential      12
  2038. #define isc_info_rsb_ext_indexed      13
  2039. #define isc_info_rsb_ext_dbkey          14
  2040. #define isc_info_rsb_left_cross           15
  2041. #define isc_info_rsb_select          16
  2042. #define isc_info_rsb_sql_join          17
  2043. #define isc_info_rsb_simulate          18
  2044. #define isc_info_rsb_sim_cross          19
  2045. #define isc_info_rsb_once          20
  2046. #define isc_info_rsb_procedure          21
  2047.  
  2048. /**********************/
  2049. /* Bitmap expressions */
  2050. /**********************/
  2051.  
  2052. #define isc_info_rsb_and        1
  2053. #define isc_info_rsb_or            2
  2054. #define isc_info_rsb_dbkey        3
  2055. #define isc_info_rsb_index        4
  2056.  
  2057. #define isc_info_req_active               2
  2058. #define isc_info_req_inactive             3
  2059. #define isc_info_req_send                 4
  2060. #define isc_info_req_receive              5
  2061. #define isc_info_req_select               6
  2062. #define isc_info_req_sql_stall          7
  2063.  
  2064. /**************************/
  2065. /* Blob information items */
  2066. /**************************/
  2067.  
  2068. #define isc_info_blob_num_segments        4
  2069. #define isc_info_blob_max_segment         5
  2070. #define isc_info_blob_total_length        6
  2071. #define isc_info_blob_type                7
  2072.  
  2073. /*********************************/
  2074. /* Transaction information items */
  2075. /*********************************/
  2076.  
  2077. #define isc_info_tra_id                   4
  2078.  
  2079. /*****************************
  2080.  * Service action items      *
  2081.  *****************************/
  2082.  
  2083. #define isc_action_svc_backup          1    /* Starts database backup process on the server */
  2084. #define isc_action_svc_restore         2    /* Starts database restore process on the server */
  2085. #define isc_action_svc_repair          3    /* Starts database repair process on the server */
  2086. #define isc_action_svc_add_user        4    /* Adds a new user to the security database */
  2087. #define isc_action_svc_delete_user     5    /* Deletes a user record from the security database */
  2088. #define isc_action_svc_modify_user     6    /* Modifies a user record in the security database */
  2089. #define isc_action_svc_display_user    7    /* Displays a user record from the security database */
  2090. #define isc_action_svc_properties      8    /* Sets database properties */
  2091. #define isc_action_svc_add_license     9    /* Adds a license to the license file */
  2092. #define isc_action_svc_remove_license 10    /* Removes a license from the license file */
  2093. #define isc_action_svc_db_stats          11    /* Retrieves database statistics */
  2094. #define isc_action_svc_get_ib_log     12    /* Retrieves the InterBase log file from the server */
  2095.  
  2096. /*****************************
  2097.  * Service information items *
  2098.  *****************************/
  2099.  
  2100. #define isc_info_svc_svr_db_info      50    /* Retrieves the number of attachments and databases */
  2101. #define isc_info_svc_get_license      51    /* Retrieves all license keys and IDs from the license file */
  2102. #define isc_info_svc_get_license_mask 52    /* Retrieves a bitmask representing licensed options on the server */
  2103. #define isc_info_svc_get_config       53    /* Retrieves the parameters and values for IB_CONFIG */
  2104. #define isc_info_svc_version          54    /* Retrieves the version of the services manager */
  2105. #define isc_info_svc_server_version   55    /* Retrieves the version of the InterBase server */
  2106. #define isc_info_svc_implementation   56    /* Retrieves the implementation of the InterBase server */
  2107. #define isc_info_svc_capabilities     57    /* Retrieves a bitmask representing the server's capabilities */
  2108. #define isc_info_svc_user_dbpath      58    /* Retrieves the path to the security database in use by the server */
  2109. #define isc_info_svc_get_env          59    /* Retrieves the setting of $INTERBASE */
  2110. #define isc_info_svc_get_env_lock     60    /* Retrieves the setting of $INTERBASE_LCK */
  2111. #define isc_info_svc_get_env_msg      61    /* Retrieves the setting of $INTERBASE_MSG */
  2112. #define isc_info_svc_line             62    /* Retrieves 1 line of service output per call */
  2113. #define isc_info_svc_to_eof           63    /* Retrieves as much of the server output as will fit in the supplied buffer */
  2114. #define isc_info_svc_timeout          64    /* Sets / signifies a timeout value for reading service information */
  2115. #define isc_info_svc_get_licensed_users 65    /* Retrieves the number of users licensed for accessing the server */
  2116. #define isc_info_svc_limbo_trans    66    /* Retrieve the limbo transactions */
  2117. #define isc_info_svc_running        67    /* Checks to see if a service is running on an attachment */
  2118. #define isc_info_svc_get_users        68    /* Returns the user information from isc_action_svc_display_users */
  2119.  
  2120. /******************************************************
  2121.  * Parameters for isc_action_{add|delete|modify)_user *
  2122.  ******************************************************/
  2123.  
  2124. #define isc_spb_sec_userid            5
  2125. #define isc_spb_sec_groupid           6
  2126. #define isc_spb_sec_username          7
  2127. #define isc_spb_sec_password          8
  2128. #define isc_spb_sec_groupname         9
  2129. #define isc_spb_sec_firstname         10
  2130. #define isc_spb_sec_middlename        11
  2131. #define isc_spb_sec_lastname          12
  2132.  
  2133. /*******************************************************
  2134.  * Parameters for isc_action_svc_(add|remove)_license, *
  2135.  * isc_info_svc_get_license                            *
  2136.  *******************************************************/
  2137.  
  2138. #define isc_spb_lic_key               5
  2139. #define isc_spb_lic_id                6
  2140. #define isc_spb_lic_desc              7
  2141.  
  2142.  
  2143. /*****************************************
  2144.  * Parameters for isc_action_svc_backup  *
  2145.  *****************************************/
  2146.  
  2147. #define isc_spb_bkp_file                 5
  2148. #define isc_spb_bkp_factor               6
  2149. #define isc_spb_bkp_length               7
  2150. #define isc_spb_bkp_ignore_checksums     0x01
  2151. #define isc_spb_bkp_ignore_limbo         0x02
  2152. #define isc_spb_bkp_metadata_only        0x04
  2153. #define isc_spb_bkp_no_garbage_collect   0x08
  2154. #define isc_spb_bkp_old_descriptions     0x10
  2155. #define isc_spb_bkp_non_transportable    0x20
  2156. #define isc_spb_bkp_convert              0x40
  2157. #define isc_spb_bkp_expand         0x80
  2158.  
  2159. /********************************************
  2160.  * Parameters for isc_action_svc_properties *
  2161.  ********************************************/
  2162.  
  2163. #define isc_spb_prp_page_buffers        5
  2164. #define isc_spb_prp_sweep_interval        6
  2165. #define isc_spb_prp_shutdown_db            7
  2166. #define isc_spb_prp_deny_new_attachments    9
  2167. #define isc_spb_prp_deny_new_transactions    10
  2168. #define isc_spb_prp_reserve_space        11
  2169. #define isc_spb_prp_write_mode            12
  2170. #define isc_spb_prp_access_mode            13
  2171. #define isc_spb_prp_set_sql_dialect        14
  2172. #define isc_spb_prp_activate            0x0100
  2173. #define isc_spb_prp_db_online            0x0200
  2174.  
  2175. /********************************************
  2176.  * Parameters for isc_spb_prp_reserve_space *
  2177.  ********************************************/
  2178.  
  2179. #define isc_spb_prp_res_use_full    35
  2180. #define isc_spb_prp_res            36
  2181.  
  2182. /******************************************
  2183.  * Parameters for isc_spb_prp_write_mode  *
  2184.  ******************************************/
  2185.  
  2186. #define isc_spb_prp_wm_async        37
  2187. #define isc_spb_prp_wm_sync            38
  2188.  
  2189. /******************************************
  2190.  * Parameters for isc_spb_prp_access_mode *
  2191.  ******************************************/
  2192.  
  2193. #define isc_spb_prp_am_readonly        39
  2194. #define isc_spb_prp_am_readwrite    40
  2195.  
  2196. /*****************************************
  2197.  * Parameters for isc_action_svc_repair  *
  2198.  *****************************************/
  2199.  
  2200. #define isc_spb_rpr_commit_trans        15
  2201. #define isc_spb_rpr_rollback_trans        34
  2202. #define isc_spb_rpr_recover_two_phase    17
  2203. #define isc_spb_tra_id                    18
  2204. #define isc_spb_single_tra_id            19
  2205. #define isc_spb_multi_tra_id            20
  2206. #define isc_spb_tra_state                21
  2207. #define isc_spb_tra_state_limbo            22
  2208. #define isc_spb_tra_state_commit        23
  2209. #define isc_spb_tra_state_rollback        24
  2210. #define isc_spb_tra_state_unknown        25
  2211. #define isc_spb_tra_host_site            26
  2212. #define isc_spb_tra_remote_site            27
  2213. #define isc_spb_tra_db_path                28
  2214. #define isc_spb_tra_advise                29
  2215. #define isc_spb_tra_advise_commit        30
  2216. #define isc_spb_tra_advise_rollback        31
  2217. #define isc_spb_tra_advise_unknown        33
  2218.  
  2219. #define isc_spb_rpr_validate_db            0x01
  2220. #define isc_spb_rpr_sweep_db            0x02
  2221. #define isc_spb_rpr_mend_db                0x04
  2222. #define isc_spb_rpr_list_limbo_trans    0x08
  2223. #define isc_spb_rpr_check_db            0x10
  2224. #define isc_spb_rpr_ignore_checksum        0x20
  2225. #define isc_spb_rpr_kill_shadows        0x40
  2226. #define isc_spb_rpr_full                0x80
  2227.  
  2228. /*****************************************
  2229.  * Parameters for isc_action_svc_restore *
  2230.  *****************************************/
  2231.  
  2232. #define isc_spb_res_buffers                9
  2233. #define isc_spb_res_page_size            10
  2234. #define isc_spb_res_length                11
  2235. #define isc_spb_res_access_mode            12
  2236. #define isc_spb_res_deactivate_idx        0x0100
  2237. #define isc_spb_res_no_shadow            0x0200
  2238. #define isc_spb_res_no_validity            0x0400
  2239. #define isc_spb_res_one_at_a_time        0x0800
  2240. #define isc_spb_res_replace                0x1000
  2241. #define isc_spb_res_create                0x2000
  2242. #define isc_spb_res_use_all_space        0x4000
  2243.  
  2244. /******************************************
  2245.  * Parameters for isc_spb_res_access_mode  *
  2246.  ******************************************/
  2247.  
  2248. #define isc_spb_res_am_readonly            isc_spb_prp_am_readonly
  2249. #define isc_spb_res_am_readwrite        isc_spb_prp_am_readwrite
  2250.  
  2251. /*******************************************
  2252.  * Parameters for isc_info_svc_svr_db_info *
  2253.  *******************************************/
  2254.  
  2255. #define isc_spb_num_att            5
  2256. #define isc_spb_num_db            6
  2257.  
  2258. /*****************************************
  2259.  * Parameters for isc_info_svc_db_stats  *
  2260.  *****************************************/
  2261.  
  2262. #define isc_spb_sts_data_pages        0x01
  2263. #define isc_spb_sts_db_log            0x02
  2264. #define isc_spb_sts_hdr_pages        0x04
  2265. #define isc_spb_sts_idx_pages        0x08
  2266. #define isc_spb_sts_sys_relations    0x10
  2267. #define isc_spb_sts_record_versions    0x20
  2268. #define isc_spb_sts_table            0x40
  2269.  
  2270. /*************************/
  2271. /* SQL information items */
  2272. /*************************/
  2273.  
  2274. #define isc_info_sql_select               4
  2275. #define isc_info_sql_bind                 5
  2276. #define isc_info_sql_num_variables        6
  2277. #define isc_info_sql_describe_vars        7
  2278. #define isc_info_sql_describe_end         8
  2279. #define isc_info_sql_sqlda_seq            9
  2280. #define isc_info_sql_message_seq          10
  2281. #define isc_info_sql_type                 11
  2282. #define isc_info_sql_sub_type             12
  2283. #define isc_info_sql_scale                13
  2284. #define isc_info_sql_length               14
  2285. #define isc_info_sql_null_ind             15
  2286. #define isc_info_sql_field                16
  2287. #define isc_info_sql_relation             17
  2288. #define isc_info_sql_owner                18
  2289. #define isc_info_sql_alias                19
  2290. #define isc_info_sql_sqlda_start          20
  2291. #define isc_info_sql_stmt_type            21
  2292. #define isc_info_sql_get_plan             22
  2293. #define isc_info_sql_records          23
  2294. #define isc_info_sql_batch_fetch      24
  2295.  
  2296. /*********************************/
  2297. /* SQL information return values */
  2298. /*********************************/
  2299.  
  2300. #define isc_info_sql_stmt_select          1
  2301. #define isc_info_sql_stmt_insert          2
  2302. #define isc_info_sql_stmt_update          3
  2303. #define isc_info_sql_stmt_delete          4
  2304. #define isc_info_sql_stmt_ddl             5
  2305. #define isc_info_sql_stmt_get_segment     6
  2306. #define isc_info_sql_stmt_put_segment     7
  2307. #define isc_info_sql_stmt_exec_procedure  8
  2308. #define isc_info_sql_stmt_start_trans     9
  2309. #define isc_info_sql_stmt_commit          10
  2310. #define isc_info_sql_stmt_rollback        11
  2311. #define isc_info_sql_stmt_select_for_upd  12
  2312. #define isc_info_sql_stmt_set_generator   13
  2313. #define isc_info_sql_stmt_savepoint       14
  2314.  
  2315.  
  2316. /***********************************/
  2317. /* Server configuration key values */
  2318. /***********************************/
  2319.  
  2320. /* Not available in Firebird 1.5 */
  2321.  
  2322.  
  2323. /**********************************************/
  2324. /* Dynamic Data Definition Language operators */
  2325. /**********************************************/
  2326.  
  2327. /******************/
  2328. /* Version number */
  2329. /******************/
  2330.  
  2331. #define isc_dyn_version_1                 1
  2332. #define isc_dyn_eoc                       255
  2333.  
  2334. /******************************/
  2335. /* Operations (may be nested) */
  2336. /******************************/
  2337.  
  2338. #define isc_dyn_begin                     2
  2339. #define isc_dyn_end                       3
  2340. #define isc_dyn_if                        4
  2341. #define isc_dyn_def_database              5
  2342. #define isc_dyn_def_global_fld            6
  2343. #define isc_dyn_def_local_fld             7
  2344. #define isc_dyn_def_idx                   8
  2345. #define isc_dyn_def_rel                   9
  2346. #define isc_dyn_def_sql_fld               10
  2347. #define isc_dyn_def_view                  12
  2348. #define isc_dyn_def_trigger               15
  2349. #define isc_dyn_def_security_class        120
  2350. #define isc_dyn_def_dimension             140
  2351. #define isc_dyn_def_generator             24
  2352. #define isc_dyn_def_function              25
  2353. #define isc_dyn_def_filter                26
  2354. #define isc_dyn_def_function_arg          27
  2355. #define isc_dyn_def_shadow                34
  2356. #define isc_dyn_def_trigger_msg           17
  2357. #define isc_dyn_def_file                  36
  2358. #define isc_dyn_mod_database              39
  2359. #define isc_dyn_mod_rel                   11
  2360. #define isc_dyn_mod_global_fld            13
  2361. #define isc_dyn_mod_idx                   102
  2362. #define isc_dyn_mod_local_fld             14
  2363. #define isc_dyn_mod_sql_fld          216
  2364. #define isc_dyn_mod_view                  16
  2365. #define isc_dyn_mod_security_class        122
  2366. #define isc_dyn_mod_trigger               113
  2367. #define isc_dyn_mod_trigger_msg           28
  2368. #define isc_dyn_delete_database           18
  2369. #define isc_dyn_delete_rel                19
  2370. #define isc_dyn_delete_global_fld         20
  2371. #define isc_dyn_delete_local_fld          21
  2372. #define isc_dyn_delete_idx                22
  2373. #define isc_dyn_delete_security_class     123
  2374. #define isc_dyn_delete_dimensions         143
  2375. #define isc_dyn_delete_trigger            23
  2376. #define isc_dyn_delete_trigger_msg        29
  2377. #define isc_dyn_delete_filter             32
  2378. #define isc_dyn_delete_function           33
  2379. #define isc_dyn_delete_shadow             35
  2380. #define isc_dyn_grant                     30
  2381. #define isc_dyn_revoke                    31
  2382. #define isc_dyn_def_primary_key           37
  2383. #define isc_dyn_def_foreign_key           38
  2384. #define isc_dyn_def_unique                40
  2385. #define isc_dyn_def_procedure             164
  2386. #define isc_dyn_delete_procedure          165
  2387. #define isc_dyn_def_parameter             135
  2388. #define isc_dyn_delete_parameter          136
  2389. #define isc_dyn_mod_procedure             175
  2390. #define isc_dyn_def_log_file              176
  2391. #define isc_dyn_def_cache_file            180
  2392. #define isc_dyn_def_exception             181
  2393. #define isc_dyn_mod_exception             182
  2394. #define isc_dyn_del_exception             183
  2395. #define isc_dyn_drop_log                  194
  2396. #define isc_dyn_drop_cache                195
  2397. #define isc_dyn_def_default_log           202
  2398.  
  2399. /***********************/
  2400. /* View specific stuff */
  2401. /***********************/
  2402.  
  2403. #define isc_dyn_view_blr                  43
  2404. #define isc_dyn_view_source               44
  2405. #define isc_dyn_view_relation             45
  2406. #define isc_dyn_view_context              46
  2407. #define isc_dyn_view_context_name         47
  2408.  
  2409. /**********************/
  2410. /* Generic attributes */
  2411. /**********************/
  2412.  
  2413. #define isc_dyn_rel_name                  50
  2414. #define isc_dyn_fld_name                  51
  2415. #define isc_dyn_new_fld_name          215
  2416. #define isc_dyn_idx_name                  52
  2417. #define isc_dyn_description               53
  2418. #define isc_dyn_security_class            54
  2419. #define isc_dyn_system_flag               55
  2420. #define isc_dyn_update_flag               56
  2421. #define isc_dyn_prc_name                  166
  2422. #define isc_dyn_prm_name                  137
  2423. #define isc_dyn_sql_object                196
  2424. #define isc_dyn_fld_character_set_name    174
  2425.  
  2426. /********************************/
  2427. /* Relation specific attributes */
  2428. /********************************/
  2429.  
  2430. #define isc_dyn_rel_dbkey_length          61
  2431. #define isc_dyn_rel_store_trig            62
  2432. #define isc_dyn_rel_modify_trig           63
  2433. #define isc_dyn_rel_erase_trig            64
  2434. #define isc_dyn_rel_store_trig_source     65
  2435. #define isc_dyn_rel_modify_trig_source    66
  2436. #define isc_dyn_rel_erase_trig_source     67
  2437. #define isc_dyn_rel_ext_file              68
  2438. #define isc_dyn_rel_sql_protection        69
  2439. #define isc_dyn_rel_constraint            162
  2440. #define isc_dyn_delete_rel_constraint     163
  2441.  
  2442. /************************************/
  2443. /* Global field specific attributes */
  2444. /************************************/
  2445.  
  2446. #define isc_dyn_fld_type                  70
  2447. #define isc_dyn_fld_length                71
  2448. #define isc_dyn_fld_scale                 72
  2449. #define isc_dyn_fld_sub_type              73
  2450. #define isc_dyn_fld_segment_length        74
  2451. #define isc_dyn_fld_query_header          75
  2452. #define isc_dyn_fld_edit_string           76
  2453. #define isc_dyn_fld_validation_blr        77
  2454. #define isc_dyn_fld_validation_source     78
  2455. #define isc_dyn_fld_computed_blr          79
  2456. #define isc_dyn_fld_computed_source       80
  2457. #define isc_dyn_fld_missing_value         81
  2458. #define isc_dyn_fld_default_value         82
  2459. #define isc_dyn_fld_query_name            83
  2460. #define isc_dyn_fld_dimensions            84
  2461. #define isc_dyn_fld_not_null              85
  2462. #define isc_dyn_fld_precision             86
  2463. #define isc_dyn_fld_char_length           172
  2464. #define isc_dyn_fld_collation             173
  2465. #define isc_dyn_fld_default_source        193
  2466. #define isc_dyn_del_default               197
  2467. #define isc_dyn_del_validation            198
  2468. #define isc_dyn_single_validation         199
  2469. #define isc_dyn_fld_character_set         203
  2470.  
  2471. /***********************************/
  2472. /* Local field specific attributes */
  2473. /***********************************/
  2474.  
  2475. #define isc_dyn_fld_source                90
  2476. #define isc_dyn_fld_base_fld              91
  2477. #define isc_dyn_fld_position              92
  2478. #define isc_dyn_fld_update_flag           93
  2479.  
  2480. /*****************************/
  2481. /* Index specific attributes */
  2482. /*****************************/
  2483.  
  2484. #define isc_dyn_idx_unique                100
  2485. #define isc_dyn_idx_inactive              101
  2486. #define isc_dyn_idx_type                  103
  2487. #define isc_dyn_idx_foreign_key           104
  2488. #define isc_dyn_idx_ref_column            105
  2489. #define isc_dyn_idx_statistic          204
  2490.  
  2491. /*******************************/
  2492. /* Trigger specific attributes */
  2493. /*******************************/
  2494.  
  2495. #define isc_dyn_trg_type                  110
  2496. #define isc_dyn_trg_blr                   111
  2497. #define isc_dyn_trg_source                112
  2498. #define isc_dyn_trg_name                  114
  2499. #define isc_dyn_trg_sequence              115
  2500. #define isc_dyn_trg_inactive              116
  2501. #define isc_dyn_trg_msg_number            117
  2502. #define isc_dyn_trg_msg                   118
  2503.  
  2504. /**************************************/
  2505. /* Security Class specific attributes */
  2506. /**************************************/
  2507.  
  2508. #define isc_dyn_scl_acl                   121
  2509. #define isc_dyn_grant_user                130
  2510. #define isc_dyn_grant_user_explicit       219
  2511. #define isc_dyn_grant_proc                186
  2512. #define isc_dyn_grant_trig                187
  2513. #define isc_dyn_grant_view                188
  2514. #define isc_dyn_grant_options             132
  2515. #define isc_dyn_grant_user_group          205
  2516. #define isc_dyn_grant_role                218
  2517.  
  2518.  
  2519. /**********************************/
  2520. /* Dimension specific information */
  2521. /**********************************/
  2522.  
  2523. #define isc_dyn_dim_lower                 141
  2524. #define isc_dyn_dim_upper                 142
  2525.  
  2526. /****************************/
  2527. /* File specific attributes */
  2528. /****************************/
  2529.  
  2530. #define isc_dyn_file_name                 125
  2531. #define isc_dyn_file_start                126
  2532. #define isc_dyn_file_length               127
  2533. #define isc_dyn_shadow_number             128
  2534. #define isc_dyn_shadow_man_auto           129
  2535. #define isc_dyn_shadow_conditional        130
  2536.  
  2537. /********************************/
  2538. /* Log file specific attributes */
  2539. /********************************/
  2540.  
  2541. #define isc_dyn_log_file_sequence         177
  2542. #define isc_dyn_log_file_partitions       178
  2543. #define isc_dyn_log_file_serial           179
  2544. #define isc_dyn_log_file_overflow         200
  2545. #define isc_dyn_log_file_raw          201
  2546.  
  2547. /***************************/
  2548. /* Log specific attributes */
  2549. /***************************/
  2550.  
  2551. #define isc_dyn_log_group_commit_wait     189
  2552. #define isc_dyn_log_buffer_size           190
  2553. #define isc_dyn_log_check_point_length    191
  2554. #define isc_dyn_log_num_of_buffers        192
  2555.  
  2556. /********************************/
  2557. /* Function specific attributes */
  2558. /********************************/
  2559.  
  2560. #define isc_dyn_function_name             145
  2561. #define isc_dyn_function_type             146
  2562. #define isc_dyn_func_module_name          147
  2563. #define isc_dyn_func_entry_point          148
  2564. #define isc_dyn_func_return_argument      149
  2565. #define isc_dyn_func_arg_position         150
  2566. #define isc_dyn_func_mechanism            151
  2567. #define isc_dyn_filter_in_subtype         152
  2568. #define isc_dyn_filter_out_subtype        153
  2569.  
  2570.  
  2571. #define isc_dyn_description2          154
  2572. #define isc_dyn_fld_computed_source2      155
  2573. #define isc_dyn_fld_edit_string2      156
  2574. #define isc_dyn_fld_query_header2      157
  2575. #define isc_dyn_fld_validation_source2      158
  2576. #define isc_dyn_trg_msg2          159
  2577. #define isc_dyn_trg_source2          160
  2578. #define isc_dyn_view_source2          161
  2579. #define isc_dyn_xcp_msg2          184
  2580.  
  2581. /*********************************/
  2582. /* Generator specific attributes */
  2583. /*********************************/
  2584.  
  2585. #define isc_dyn_generator_name            95
  2586. #define isc_dyn_generator_id              96
  2587.  
  2588. /*********************************/
  2589. /* Procedure specific attributes */
  2590. /*********************************/
  2591.  
  2592. #define isc_dyn_prc_inputs                167
  2593. #define isc_dyn_prc_outputs               168
  2594. #define isc_dyn_prc_source                169
  2595. #define isc_dyn_prc_blr                   170
  2596. #define isc_dyn_prc_source2               171
  2597.  
  2598. /*********************************/
  2599. /* Parameter specific attributes */
  2600. /*********************************/
  2601.  
  2602. #define isc_dyn_prm_number                138
  2603. #define isc_dyn_prm_type                  139
  2604.  
  2605. /********************************/
  2606. /* Relation specific attributes */
  2607. /********************************/
  2608.  
  2609. #define isc_dyn_xcp_msg                   185
  2610.  
  2611. /**********************************************/
  2612. /* Cascading referential integrity values     */
  2613. /**********************************************/
  2614. #define isc_dyn_foreign_key_update        205
  2615. #define isc_dyn_foreign_key_delete        206
  2616. #define isc_dyn_foreign_key_cascade       207
  2617. #define isc_dyn_foreign_key_default       208
  2618. #define isc_dyn_foreign_key_null          209
  2619. #define isc_dyn_foreign_key_none          210
  2620.  
  2621. /***********************/
  2622. /* SQL role values     */
  2623. /***********************/
  2624. #define isc_dyn_def_sql_role              211
  2625. #define isc_dyn_sql_role_name             212
  2626. #define isc_dyn_grant_admin_options       213
  2627. #define isc_dyn_del_sql_role              214
  2628. /* 215 & 216 are used some lines above. */
  2629.  
  2630. /**********************************************/
  2631. /* Generators again                           */
  2632. /**********************************************/
  2633.  
  2634. #ifndef __cplusplus                     /* c definitions */
  2635. #define gds_dyn_delete_generator          217
  2636. #else                                   /* c++ definitions */
  2637. const unsigned char gds_dyn_delete_generator       = 217;
  2638. #endif
  2639.  
  2640. /****************************/
  2641. /* Last $dyn value assigned */
  2642. /****************************/
  2643.  
  2644. #define isc_dyn_last_dyn_value            219
  2645.  
  2646. /******************************************/
  2647. /* Array slice description language (SDL) */
  2648. /******************************************/
  2649.  
  2650. #define isc_sdl_version1                  1
  2651. #define isc_sdl_eoc                       255
  2652. #define isc_sdl_relation                  2
  2653. #define isc_sdl_rid                       3
  2654. #define isc_sdl_field                     4
  2655. #define isc_sdl_fid                       5
  2656. #define isc_sdl_struct                    6
  2657. #define isc_sdl_variable                  7
  2658. #define isc_sdl_scalar                    8
  2659. #define isc_sdl_tiny_integer              9
  2660. #define isc_sdl_short_integer             10
  2661. #define isc_sdl_long_integer              11
  2662. #define isc_sdl_literal                   12
  2663. #define isc_sdl_add                       13
  2664. #define isc_sdl_subtract                  14
  2665. #define isc_sdl_multiply                  15
  2666. #define isc_sdl_divide                    16
  2667. #define isc_sdl_negate                    17
  2668. #define isc_sdl_eql                       18
  2669. #define isc_sdl_neq                       19
  2670. #define isc_sdl_gtr                       20
  2671. #define isc_sdl_geq                       21
  2672. #define isc_sdl_lss                       22
  2673. #define isc_sdl_leq                       23
  2674. #define isc_sdl_and                       24
  2675. #define isc_sdl_or                        25
  2676. #define isc_sdl_not                       26
  2677. #define isc_sdl_while                     27
  2678. #define isc_sdl_assignment                28
  2679. #define isc_sdl_label                     29
  2680. #define isc_sdl_leave                     30
  2681. #define isc_sdl_begin                     31
  2682. #define isc_sdl_end                       32
  2683. #define isc_sdl_do3                       33
  2684. #define isc_sdl_do2                       34
  2685. #define isc_sdl_do1                       35
  2686. #define isc_sdl_element                   36
  2687.  
  2688. /********************************************/
  2689. /* International text interpretation values */
  2690. /********************************************/
  2691.  
  2692. #define isc_interp_eng_ascii              0
  2693. #define isc_interp_jpn_sjis               5
  2694. #define isc_interp_jpn_euc                6
  2695.  
  2696. /*******************/
  2697. /* SQL definitions */
  2698. /*******************/
  2699.  
  2700. #define SQL_TEXT                           452
  2701. #define SQL_VARYING                        448
  2702. #define SQL_SHORT                          500
  2703. #define SQL_LONG                           496
  2704. #define SQL_FLOAT                          482
  2705. #define SQL_DOUBLE                         480
  2706. #define SQL_D_FLOAT                        530
  2707. #define SQL_TIMESTAMP                      510
  2708. #define SQL_BLOB                           520
  2709. #define SQL_ARRAY                          540
  2710. #define SQL_QUAD                           550
  2711. #define SQL_TYPE_TIME               560
  2712. #define SQL_TYPE_DATE                      570
  2713. #define SQL_INT64               580
  2714.  
  2715. /* Historical alias for pre V6 applications */
  2716. #define SQL_DATE            SQL_TIMESTAMP
  2717.  
  2718. /*****************/
  2719. /* Blob Subtypes */
  2720. /*****************/
  2721.  
  2722. /* types less than zero are reserved for customer use */
  2723.  
  2724. #define isc_blob_untyped                   0
  2725.  
  2726. /* internal subtypes */
  2727.  
  2728. #define isc_blob_text                      1
  2729. #define isc_blob_blr                       2
  2730. #define isc_blob_acl                       3
  2731. #define isc_blob_ranges                    4
  2732. #define isc_blob_summary                   5
  2733. #define isc_blob_format                    6
  2734. #define isc_blob_tra                       7
  2735. #define isc_blob_extfile                   8
  2736.  
  2737. /* the range 20-30 is reserved for dBASE and Paradox types */
  2738.  
  2739. #define isc_blob_formatted_memo            20
  2740. #define isc_blob_paradox_ole               21
  2741. #define isc_blob_graphic                   22
  2742. #define isc_blob_dbase_ole                 23
  2743. #define isc_blob_typed_binary              24
  2744.  
  2745. /* Deprecated definitions maintained for compatibility only */
  2746.  
  2747. #define isc_info_db_SQL_dialect           62
  2748. #define isc_dpb_SQL_dialect               63
  2749. #define isc_dpb_set_db_SQL_dialect        65
  2750.  
  2751.  
  2752. #include "iberror.h"
  2753.  
  2754. #endif /* JRD_IBASE_H */
  2755.  
  2756.